I recently compiled and installed ooRexx 4.1.3 64bit on a CentOS 5.5 system. I also have ooRexx 4.1.1 running on Windows. Below are the values returned by various functions - Time('o') on Windows adjusts for Daylight Savings but on Linux always shows the offset for Standard Time.
OS | Date() Time() | Time('t') | Time ('o') | System Date |
---|---|---|---|---|
Windows | 1 Nov 2014 20:00:00 | 1414872000 | -14400000000 | |
Linux | 1 Nov 2014 20:00:01 | 1414872001 | -18000000000 | Sat Nov 1 20:00:01 EDT 2014 |
Windows | 2 Nov 2014 04:00:09 | 1414900809 | -18000000000 | |
Linux | 2 Nov 2014 04:00:01 | 1414900801 | -18000000000 | Sun Nov 2 04:00:01 EST 2014 |
This problem cropped in in an application that needs to adjust the local Time('t') to reflect UTC. I have also seen this problem on ARM systems.
Anonymous
This bug is still present in 4.2.0.
I noticed it in the "offset" method of the datetime class.
Committed 5.0 code fix with revision [r11326]
On Linux, we now should the the following:
Tests and feeedback welcome!!
Thanks for reporting.
Related
Commit: [r11326]
Above fixes is just the
time('o')
issue.ooRexx currently uses a single (the current) timezone offset for all
.DateTime
instances.Not sure, if
.DateTime
arithmetic could handle specific offsets for each instance.If we think that's an issue, this will have to go into s separate ticket.
The datetime instances should be performing arithmetic using a timestamp that has been adjusted to UTC time, so objects for the same UTC in different timezones should be considered equal.
I'm still not sure whether the following is a bug.
Should the 23 Oct - timestamp always show an offset of two, and 30 Oct always one? (I believe this is how file time stamp handling works)
WARNING: running the following Windows-only code will change your Windows system time!
will output
As this program runs on MET, which is UCT+1, unless summer savings time is in effect which would be UCT+2.
Winter time will come up with the last Sunday in October (starting October 29th), if not mistaken, so
Here a version that uses .dateTime only:
Running the above yields (note the difference of one hour when doing the subtraction with explicit UTC offsets):
To answer my own question:
No, it's not a bug, as rexxref states "The default offset is the current system timezone offset."
So, no more fixes required.
I'll keep this open until after the EU DST change, to allow for any tests results to be reported