Date today asDateAndTime does not return a DateAndTime in the local timezone

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Date today asDateAndTime does not return a DateAndTime in the local timezone

GLASS mailing list
Hi there,

`DateAndTime today` returns a DateAndTime instance in the local timezone. (e.g. 2017-03-14T00:00:00+01:00)
`Date today asDateAndTime` returns a DateAndTime instance in the UTC timezone (e.g. 2017-03-14T00:00:00+00:00)

The relevant commit that changed this behavior in GLASS/GsDevKit dates back from 08/2014 [1].
Before that change, the above pieces of code would both return an instance in the local timezone

I’m inclined to say it’s more consistent if both return an instance in the local timezone.
Thoughts?

cheers

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Date today asDateAndTime does not return a DateAndTime in the local timezone

GLASS mailing list


On 03/14/2017 04:44 AM, Johan Brichau via Glass wrote:

> Hi there,
>
> `DateAndTime today` returns a DateAndTime instance in the local
> timezone. (e.g. 2017-03-14T00:00:00+01:00)
> `Date today asDateAndTime` returns a DateAndTime instance in the UTC
> timezone (e.g. 2017-03-14T00:00:00+00:00)
>
> The relevant commit that changed this behavior in GLASS/GsDevKit dates
> back from 08/2014 [1].
> Before that change, the above pieces of code would both return an
> instance in the local timezone
>
> I’m inclined to say it’s more consistent if both return an instance in
> the local timezone.
> Thoughts?
I agree ... it is true that passing in a Duration instance instead of
nil, improves performance, but at the expense of giving a wrong answer,
which is not right ...

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Date today asDateAndTime does not return a DateAndTime in the local timezone

GLASS mailing list
I’ll send in a pull request.
Would be great as this single patch eliminates all our test failures on Gemstone 3.2 (with the last GLASS version :)

Johan

> On 14 Mar 2017, at 17:30, Dale Henrichs via Glass <[hidden email]> wrote:
>
>
>
> On 03/14/2017 04:44 AM, Johan Brichau via Glass wrote:
>> Hi there,
>>
>> `DateAndTime today` returns a DateAndTime instance in the local timezone. (e.g. 2017-03-14T00:00:00+01:00)
>> `Date today asDateAndTime` returns a DateAndTime instance in the UTC timezone (e.g. 2017-03-14T00:00:00+00:00)
>>
>> The relevant commit that changed this behavior in GLASS/GsDevKit dates back from 08/2014 [1].
>> Before that change, the above pieces of code would both return an instance in the local timezone
>>
>> I’m inclined to say it’s more consistent if both return an instance in the local timezone.
>> Thoughts?
> I agree ... it is true that passing in a Duration instance instead of nil, improves performance, but at the expense of giving a wrong answer, which is not right ...
>
> Dale
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass