Manipulated Time Displays

This is the variable being used:
$(time UTC “ddd DD MMM YYYY, HHmmss”) Zulu

This is what correctly displays (at the current time called):
Wed 08 May 2019, 211602 Zulu

My question is
How do I use the variable so that the manipulated time adds 1286 years to display this?:
Wed 08 May 3305, 211602 Zulu
How do I add 1286 years to the time?

" We use moment.js to compute time, so you can use their formatting guide to create a format you’d like to use." -https://docs.nightbot.tv/commands/variables/time
Formatting how I’d like to display time is the easy part. I want to add 1286 years to the displayed time.
What if there was an “Elite Danergous” time zone? ha!

moment.js appears to only address HTML-style coding (I am no coder) and does not address integrating Nightbot command variables “$()”
moment().add(1286, ‘y’);

Please help. Thank you.

@sirphist

Wonky solution using $(eval)

$(eval a=`$(time UTC "ddd DD MMM YYYY, HHmmss") Zulu`;y=new Date().getUTCFullYear();a.replace(y,y+1286))

Man oh man! I can’t thank you enough! :sob::partying_face:

This is the variable being used:
$(countdown 7:00 AM UTC)

This is what correctly displays (at the current time called):
5 hours 45 minutes 57 seconds

My question is
How do I use Nightbot’s command variables to display a weekly countdown?

I wish it was easier. See how easy it SHOULD be?
$(countdown Thursday 7:00 AM UTC)
returns this:
Invalid countdown date/time specified. To learn about the right format to use, check out https://docs.nightbot.tv/commands/variables/countdown

Please advise. Thank you.

Took the solution from this post.

Tweaked it a bit to count down to every Thursday 7AM UTC.

$(countdown $(eval h=7;n=new Date();s=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()+(4-n.getUTCDay())%7,(h%24+24)%24));if(s<n)s.setDate(s.getDate()+7);s.toLocaleTimeString("en-US",{hour12:true,month:"numeric",day:"numeric",year:"numeric"}).replace(/\//g," ").replace(/,/g,"").replace(/(?=\b\d\b)/g,"0")+" "+Intl.DateTimeFormat().resolvedOptions().timeZone))

I really do appreciate all your help! I don’t understand any of that. Thank you! :smiling_face_with_three_hearts:

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