Nightbot Customized Time Variable

Hey, I made a customized time variable here it is:

$(eval TimeVariable=["+/-","hh","mm","ss","yes/no"];a="$(time UTC "hh:mm:ss:a")".split(":");$(urlfetch json https://pastebin.com/raw/92vSCCJG))

The first +/- is whether you want to add or subtract time.
The hh is any number 0-12 that you want to add or subtract.
The mm and ss is any number 0-59 you want to add or subtract.
The yes/no is whether you want the seconds showing (Ex.yes: 12:30:12 am,no: 12:30)
Error messages will come up if any field is filled incorrectly.

Edit: Try to avoid adding and subtracting over 12:00:00 hours as if you do it can cause the am/pm to not update properly. :wink:

Hope someone finds some use for this :slight_smile:

For anyone interested in seeing the pastebin check here

Note:Technically the input time can be from any timezone Nightbot is compatible with (See list here) so it does not have to be “UTC” in the $(time) variable.


Ps. I do not know whether or not this is considered an API or not but if it is fell free to tell me or if you can move it to the API section go ahead.

2 Likes

Thanks! I’ve removed the timer that auto-locks the post after 14 days of inactivity.

2 Likes