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

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Tue Mar 14 09:30:34 PDT 2017



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


More information about the Glass mailing list