• TZ or TZUTC environment variable

    From Alan Ianson@1:153/757 to All on Sun May 12 02:59:58 2019
    Hello All,

    I've noticed that messages that originate here have a TZUTC kludge that says -0800. That is correct for PST but it is PDT now so my TZUTC should be -0700. How can I set BBBS to use the correct TZUTC during PDT?

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757)
  • From Robert Wolfe@1:116/18.2 to Alan Ianson on Thu May 16 22:17:46 2019
    I've noticed that messages that originate here have a TZUTC kludge that says -0800. That is correct for PST but it is PDT now so my TZUTC should be -0700. How can I set BBBS to use the correct TZUTC during PDT?

    One would think that this would be an OS setting and not a setting in the BBS software itself. But, I could be wrong though.

    --- BBBS/2 v4.10 Toy-4
    * Origin: Omicron Theta/2 * Southaven MS * winserver.org (1:116/18.2)
  • From Alan Ianson@1:153/757 to Robert Wolfe on Fri May 17 06:56:30 2019
    I've noticed that messages that originate here have a TZUTC kludge that says >>-0800. That is correct for PST but it is PDT now so my TZUTC should be -0700. >> How can I set BBBS to use the correct TZUTC during PDT?

    One would think that this would be an OS setting and not a setting in the BBS software itself. But, I could be wrong though.

    BBBS seems to get the time right ok in Pacific Standard Time. It's when we spring ahead it doesn't change to Pacific Daylight Time. The computers clock does change but the TZUTC: kludge doesn't.

    I have found here that setting the TZ and TZUTC environments is needed, at least in PDT. In my case I set TZ=PDT+7 and TZUTC=-0700 and now my TZUTC kludge
    is correct.

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757)
  • From Jeff Smith@1:282/1031 to Alan Ianson on Fri May 17 08:47:24 2019
    Hello Alan.

    BBBS seems to get the time right ok in Pacific Standard Time. It's when we spring ahead it doesn't change to Pacific Daylight Time. The computers clock does change but the TZUTC: kludge doesn't. I have found here that setting the TZ and TZUTC environments is needed, at least in PDT. In my case I set TZ=PDT+7 and TZUTC=-0700 and now my TZUTC kludg is correct.

    Maybe as a temp workaround in the script file that starts BBBSD you could do a date check. And when the Daylight Saving dates are reached then the TZ and the TZUTC variables could be changed as necessary. For me I would do it via a Bash script.

    Jeff



    --- BBBS/Li6 v4.10 Toy-4
    * Origin: Fidoneet: The Ouija Board - Anoka, MN -bbs.ouijabrd.net (1:282/1031)
  • From Alan Ianson@1:153/757 to Jeff Smith on Fri May 17 12:24:32 2019
    Hello Alan.

    BBBS seems to get the time right ok in Pacific Standard Time. It's when we >> spring ahead it doesn't change to Pacific Daylight Time. The computers clock >>does change but the TZUTC: kludge doesn't. I have found here that setting the >> TZ and TZUTC environments is needed, at least in PDT. In my case I set
    TZ=PDT+7 and TZUTC=-0700 and now my TZUTC kludg is correct.

    Maybe as a temp workaround in the script file that starts BBBSD you could do a >date check.

    Yep, I haven't permantly set the environment yet so I guess I should find a way
    to do that.

    And when the Daylight Saving dates are reached then the TZ and the TZUTC variables could be changed as necessary. For me I would do it via a Bash script.

    Your TZUTC kludge is also off by an hour so it may be a problem for all BBBS users.

    I think setting TZ=CDT+5 and TZUTC=-0500 would work for you.

    --- BBBS/Li6 v4.10 Toy-4
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757)
  • From mark lewis@1:3634/12.73 to Jeff Smith on Fri May 17 19:02:08 2019

    On 2019 May 17 08:47:24, you wrote to Alan Ianson:

    BBBS seems to get the time right ok in Pacific Standard Time. It's when
    we spring ahead it doesn't change to Pacific Daylight Time. The
    computers clock does change but the TZUTC: kludge doesn't. I have found
    here that setting the TZ and TZUTC environments is needed, at least in
    PDT. In my case I set TZ=PDT+7 and TZUTC=-0700 and now my TZUTC kludg
    is correct.

    Maybe as a temp workaround in the script file that starts BBBSD you
    could do a date check. And when the Daylight Saving dates are reached
    then the TZ and the TZUTC variables could be changed as necessary. For
    me I would do it via a Bash script.

    it should be easy enough to do ;)

    eg: $ printf "TZUTC=$(date +"%z")\n"
    TZUTC=-0400

    the real trick will be to execute it at the proper time so that the env var is set when the time changes... the quickest thing i can think of would be for the
    BBS to exit back to the script and loop through the setting before firing up the BBS again... that should be done at the proper times, though...

    the only problem with the above is that the FTSC spec for TZUTC does not allow for the '+' to be specified for timezones east of UTC... the '+' should be stripped off which makes the above quickie one-liner more involved but not impossible to handle...

    eg: $ printf "TZUTC=$(date +"%z" | sed 's/\+//')\n"

    that'll strip out the '+' if it exists and will leave the '-' alone... so if i've done this playing around correctly, something like

    export TZUTC=$(date +"%z" | sed 's/\+//')

    should work but we have the problem of updating it when daylight saving switches so there still needs to be some sort of updater executed or the BBS would have to exit to the script which would loop, reset the env var and restart the BBS...

    i whipped up this little test script...

    ==== Begin "tzutctest" ====
    printf "before setting: '%s'\n" $TZUTC
    TZUTC=$(date +"%z" | sed 's/\+//')
    export TZUTC
    printf "after setting : '%s'\n" $TZUTC
    env | grep "TZUTC"
    ==== End "tzutctest" ====

    when the script exits, TZUTC does not exist in the env so that means that a script like this will need to be used for anything that wants the TZUTC env var...

    it would probably be best if the maintainer would check and see if the code does this... the very best would be to check and set the variable when each message is posted when the TZUTC control line is added to the message... this for all messages posted... even for those uploaded via offline mail... QWK/QWKE
    and BlueWave, which ever are supported...

    one might want to see about putting the above in their ~/.bashrc so that it is set for them when they login to the system... this just in case they use external tools like a sysop reader to access the message base without having to
    login to the BBS... one might place it in the global /etc/bash.bashrc so that it is run for all accounts instead of just their personal account... instead of
    using one of the .bashrc files, one might use one of the .profile files or even
    create a tzutc.sh script and place it in /etc/profile.d...

    if one runs BBBS as a service, it would certainly need to be placed in that script before starting BBBS but then we still have the thing about resetting it
    when daylight switches over...

    FWIW: this is almost exactly the same dance i had to play on my old OS/2 setup... in that case, i had to manually edit the config.sys since that's where
    these are set and then reboot the system... that only so the native OS/2 side would get updated... the DOS side was easy enough as i just did the loop thing in the BBS .bat/.cmd files... i wrote a tool to determine the timezone since OS/2 doesn't have that in its time records unless you use one of peter moylan's
    (of weasel SMTP and ftpser server fame) tools...

    oh yeah, the TZ can also be set like this... there's two TZ formats for linux, though...

    TZ='America/New_York'
    or the POSIX format
    TZ='EST5EDT'

    which one you use depends on the software needs... some does POSIX and some does not...

    just rambling and trying to stave off depression again...

    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... I'll have two brains on drugs, scrambled with bacon, grits, toast and coffee.
    ---
    * Origin: (1:3634/12.73)