• Run JS with a different TZ

    From nelgin@VERT/EOTLBBS to Charles Blackburn on Sun Oct 15 03:09:23 2023
    Re: Run JS with a different TZ
    By: Charles Blackburn to nelgin on Sat Oct 14 2023 10:58:43

    function convertTZ(date, tzString) {
    return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString}));
    }

    You did actually try this and discovred it doesn't actually work, right?
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Charles Blackburn@VERT/THEFBO to nelgin on Sun Oct 15 22:55:26 2023
    Re: Run JS with a different TZ
    By: nelgin to Charles Blackburn on Sat Oct 14 2023 22:09:23

    Re: Run JS with a different TZ
    By: Charles Blackburn to nelgin on Sat Oct 14 2023 10:58:43

    function convertTZ(date, tzString) {
    return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString}));
    }

    You did actually try this and discovred it doesn't actually work, right?

    can't say i did, i'm not a jS programmer, but was just throwing an idea out. but there should be a way to do it. In C/Python you can do it
    in a similar way. if the string is in UTC you should be able to internally convert it to whatever TZ you want.

    Charlie

    ---
    þ Synchronet þ My Brand-New BBS
  • From MRO@VERT/BBSESINF to nelgin on Mon Oct 16 03:03:18 2023
    Re: Run JS with a different TZ
    By: nelgin to Charles Blackburn on Sat Oct 14 2023 10:09 pm

    Re: Run JS with a different TZ
    By: Charles Blackburn to nelgin on Sat Oct 14 2023 10:58:43

    function convertTZ(date, tzString) {
    return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString}));
    }

    You did actually try this and discovred it doesn't actually work, right?

    this looks like a job for Chad Jipiti
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
  • From nelgin@VERT/EOTLBBS to Charles Blackburn on Mon Oct 16 07:06:42 2023
    Re: Run JS with a different TZ
    By: Charles Blackburn to nelgin on Sun Oct 15 2023 17:55:26

    can't say i did, i'm not a jS programmer, but was just throwing an idea out. but there should be a way to do it. In C/Python you can do it
    in a similar way. if the string is in UTC you should be able to internally convert it to whatever TZ you want.

    Unforuntately, there isn't. That's why there's moment-timezone and Luxon.

    Unfortunately Luxon is too modern to work with the sbbs version of js. moment-timezone is no longer developed or supported but at least it works.
    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
  • From Charles Blackburn@VERT/THEFBO to nelgin on Mon Oct 16 18:09:06 2023
    Re: Run JS with a different TZ
    By: nelgin to Charles Blackburn on Mon Oct 16 2023 02:06:42

    Re: Run JS with a different TZ
    By: Charles Blackburn to nelgin on Sun Oct 15 2023 17:55:26
    can't say i did, i'm not a jS programmer, but was just throwing an idea out. but there should be a way to do it. In C/Python you can do it
    <CUT>
    Unforuntately, there isn't. That's why there's moment-timezone and Luxon. Unfortunately Luxon is too modern to work with the sbbs version of js. moment-timezone is no longer developed or supported but at least it works.

    well that sucks... maybe sbbs (unless there's a specific reason for it) should use the system-wide version maybe? I know it may be more work for the devs, but just my tuppence :D

    as for the latter, maybe you should fork it and take it over lol

    Charlie

    ---
    þ Synchronet þ My Brand-New BBS