Subj : Run JS with a different TZ
To   : Digital Man
From : nelgin
Date : Sat Oct 14 2023 01:39 am

 Re: Run JS with a different TZ
 By: Digital Man to nelgin on Fri Oct 13 2023 21:06:05

> Right. And environment variables are shared among on threads (e.g. nodes) of
> the sbbs instance, so even if you could set the TZ environment variable,
> you'd be changing for all threads. Likely not what you want.

Definitely not what I want.

> There's a whole new JS Date thing in the works for some future version of
> JavaScript, but that'll be aways away from being integrated with sbbs.
>
> I think the easiest thing to do would be to adjust the UTC value based on
> the UTC offset for central time (yeah, it'll change with DST) and then use
> Date.toUTCString() to convert it to a string.

I'll probably stick with using the moment-timezone library then. I use it in my weather script so I'm not unfamiliar with it, but I was trying to see if there was a more native way to handle timezone conversions.

Thanks,
---
� Synchronet � End Of The Line BBS - endofthelinebbs.com