Trying to change output of $(twitch) in certain format

Im trying to make a data sheet using nightbot commands and I want to change the data Im receiving from nightbot using variable $(twitch)

for example if I use

$(twitch $(channel) “{{uptimeAt}}”)

it will return

Thu Aug 17 2023 20:36:00 GMT+0000 (Coordinated Universal Time)

here is the problem Im facing

  1. I want to make the data according my timezone instead of GMT+00

  2. I wish to make the data in DD/MM/YYYY format

Would there be a way to change the data output using variable of $(twitch) ?

lemme know if this works for ya… i got 2 versions 12/24 hour clocks… in both cases change the zero where it says “hourOffBy=0” to the number of hours u want to change the time by, use positive numbers to go forward and negative numbers to go backward

for the 12 hour clock with am/pm…

$(eval a=$(twitch $(channel) “{{uptimeAt}}”).split( );s=b=>{hourOffBy=0;d=new Date(b.slice(1,5).join( ));d.setHours(d.getHours()+hourOffBy);e=d.getDate();f=d.getMonth()+1;return ${e>9?e:0+e}/${f>9?f:0+f}/${d.getFullYear()} at ${d.toLocalTimeString()}};a[1]!=is?s(a):a.join( ))

and for the 24 hour clock…

$(eval a=$(twitch $(channel) “{{uptimeAt}}”).split( );s=b=>{hourOffBy=0;d=new Date(b.slice(1,5).join( ));d.setHours(d.getHours()+hourOffBy);e=d.getDate();f=d.getMonth()+1;return ${e>9?e:0+e}/${f>9?f:0+f}/${d.getFullYear()} at ${d.toTimeString().split( )[0]}};a[1]!=is?s(a):a.join( ))

oh, and for some reason copy and paste changes the quotes into some other kinda character, so the quotes around {{uptimeAt}} will need to be deleted and typed back in
actually, looking at the code, the stupid formatting removed a whole buncha symbols… this won’t work from here

i can try to dm the code to u on twitch, but this stupid formatting won’t send it properly

Ah I see, so there are no internal ways in $(twitch) to process the data.

Just tried applying the code and it didn’t work as you said.

would there be any other way to get the un-corrupted code?

i dm’d it to u on twitch… unless your name is different on twitch, lol, then i dm’d it to somebody else that has the same name as u have here XD

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.