• Epoch time

    From snosniv@21:1/5 to All on Tue Oct 25 02:13:10 2022
    If I do this:
    set z {01/01/1970 00:00:00}
    set t3 [clock scan $z -format "%d/%m/%Y %H:%M:%S"]

    I get -3600 as the result, not zero?

    set z {01/01/1970 01:00:00}
    does return zero after conversion?

    Am I missing something?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Tue Oct 25 12:13:25 2022
    * snosniv <nivparsons@gmail.com>
    | If I do this:
    | set z {01/01/1970 00:00:00}
    | set t3 [clock scan $z -format "%d/%m/%Y %H:%M:%S"]

    | I get -3600 as the result, not zero?

    | set z {01/01/1970 01:00:00}
    | does return zero after conversion?

    | Am I missing something?

    Your local time zone. Check the -timezone argument for clock scan.

    set t3 [clock scan $z -format "%d/%m/%Y %H:%M:%S" -timezone :UTC]
    => 0

    https://www.tcl-lang.org/man/tcl8.6/TclCmd/clock.htm#M10

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From snosniv@21:1/5 to Ralf Fassel on Tue Nov 1 04:48:31 2022
    On Tuesday, 25 October 2022 at 11:13:29 UTC+1, Ralf Fassel wrote:
    * snosniv <nivpa...@gmail.com>
    | If I do this:
    | set z {01/01/1970 00:00:00}
    | set t3 [clock scan $z -format "%d/%m/%Y %H:%M:%S"]

    | I get -3600 as the result, not zero?

    | set z {01/01/1970 01:00:00}
    | does return zero after conversion?

    | Am I missing something?
    Your local time zone. Check the -timezone argument for clock scan.

    set t3 [clock scan $z -format "%d/%m/%Y %H:%M:%S" -timezone :UTC]
    0

    https://www.tcl-lang.org/man/tcl8.6/TclCmd/clock.htm#M10

    R'
    Ah, yes, we are in British summer time, I'll try again now we're in GMT (or UTC if you prefer).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)