Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Bug in StrToDateTime function
Wed, Jul 24 2013 5:35 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

There appears to be a bug in the StrToDateTime function with the UTC set
to true.

StrToDateTime('23/07/2013 9:00',false) = 23/07/2013 8:00

but

StrToDateTime('23/07/2013 9:00',true) = 23/08/2013 9:00

Note that the date has added 1 to the month!

--
Chris Holland
[Team Elevate]
Wed, Jul 24 2013 6:08 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

It appears that the bug is in the EncodeDateTime function:

function encodedatetime($0, $1, $2, $3, $4, $5, $6, $7)
{
   if ($7)
      return new Date(Date.UTC($0, $1, $2, $3, $4, $5, $6)).getTime();
   else
      return new Date($0, $1 - 1, $2, $3, $4, $5, $6).getTime();
};

I think if $7 is set then the line should read $1 - 1 as it does in the
second part of the function.

Chris Holland
[Team Elevate]

On 24/07/2013 10:35, Chris Holland wrote:
> There appears to be a bug in the StrToDateTime function with the UTC set
> to true.
>
> StrToDateTime('23/07/2013 9:00',false) = 23/07/2013 8:00
>
> but
>
> StrToDateTime('23/07/2013 9:00',true) = 23/08/2013 9:00
>
> Note that the date has added 1 to the month!
>
Mon, Jul 29 2013 1:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< It appears that the bug is in the EncodeDateTime function: >>

Yep, thanks, I'll make sure that this is fixed.

Tim Young
Elevate Software
www.elevatesoft.com
Image