[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] ⎕TZ and ⎕TS

From: Kacper Gutowski
Subject: [Bug-apl] ⎕TZ and ⎕TS
Date: Sun, 26 Jan 2014 19:35:41 +0100
User-agent: Mutt/1.5.21 (2010-09-15)


⎕TS doesn't properly adjust for time zone: value of 3600×⎕TZ μs (not
seconds) is added to now() before breaking it down to day time.
NB. Comment in Common.hh:75 stating that now() returns "current time as
double (seconds since epoch)" is not consistent with the fact that APL_time
is defined as int64_t and assumed to be in microseconds elsewhere.

      ⎕TZ←12 ◊ ⎕TS ◊ ⎕TZ←¯12 ◊ ⎕TS
2014 1 26 18 31 6 280
2014 1 26 18 31 6 194

Also initial value of ⎕TZ is calculated incorrectly.  It's a difference
of 60⊥(hours minutes) between localtime and gmtime but without taking year,
month, and day into account. This results in incorrect value outside the
expected [¯12,12] range when day in local zone is different than in UTC.

$ date -uR
Sun, 26 Jan 2014 18:32:48 +0000
$ TZ=Asia/Tokyo
$ date -R
Mon, 27 Jan 2014 03:32:57 +0900
$ apl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]