Friday, 25 September 2015

Re: Patch to correct Javascript date() result

In message <OUT-5605AFD5.MD-1.4.17.chris.young@unsatisfactorysoftware.co.uk>
"Chris Young" <chris.young@unsatisfactorysoftware.co.uk> wrote:

>On Fri, 25 Sep 2015 20:04:53 +0100, Dave Higton wrote:
>
>> >If you can point us to a test page, maybe we can find out whether this
>> >is RISC OS only or (as I suspect) a problem with all supported
>> >platforms?
>>
>> The attached will do.
>>
>> Please bear in mind that there are various possible paths through the
>> code that gets the date. (It's definitely the Date() function that
>> is in error, not the toString() function.) So a different platform
>> may or may not show the error.
>>
>> The addition of 3600 seconds is such a deliberate inclusion that I
>> have to ask whether it was required on some platform. It is my
>> understanding that localtime() should return the time taking into
>> account both the time zone and possible daylight savings, so really
>> it shouldn't be necessary.
>
>A quick check on AmigaOS reveals it's wrong here on two counts.... or
>maybe it's wrongly correct, I'm not sure.
>Today is 2015-09-25 21:28:16.916+02:00
>Are you getting the correct timezone on RISC OS?

Without my patch, the time is 1 hour in advance and the offset is
shown as +02:00, like you see.

With my patch, the time is correct and the offset is shown as +01:00.

It's possible that the AmigaOS code is running through the error.
All I did was prevent the error on RISC OS, leaving the code for
other platforms unchanged.

Dave

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager

No comments:

Post a Comment