Why does EST show an offset of 0 when it should be 5?

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

Why does EST show an offset of 0 when it should be 5?

Louis LaBrunda

Hi Gang,

I'm looking for a timezone entry for EST (Eastern Standard Time - winter all year long).  I would think EST would be it but it comes up with a 0 duration offset.

(EsTimeZoneDatabase timeZoneFor: 'EST') offset.
0:00:00:00

The timezone for 'US/Eastern' looks good but it will answer the wrong time in the summer.

(EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset.
-0:05:00:00

Am I confused about something?

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

dmacq
Hi Lou,

First, EST is ambiguous - it can be Eastern Standard Time (US) or Easter Summer Time (Australia). The tz data for EST has no DST transitions, and without them there is no offset. You can see that by inspecting EsTimeZoneDatabase timeZoneFor: 'EST'; the instance variable transitionTimeTable will be nil.  You generally want to stay away from /Etc timezones because they do not have DST transition data.

You are correct that (EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset should be -04:00:00. I will look into that.

Donald

On Thursday, August 21, 2014 4:48:05 PM UTC-4, Louis LaBrunda wrote:

Hi Gang,

I'm looking for a timezone entry for EST (Eastern Standard Time - winter all year long).  I would think EST would be it but it comes up with a 0 duration offset.

(EsTimeZoneDatabase timeZoneFor: 'EST') offset.
0:00:00:00

The timezone for 'US/Eastern' looks good but it will answer the wrong time in the summer.

(EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset.
-0:05:00:00

Am I confused about something?

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

Louis LaBrunda
Hi Donald,

I use US Eastern Standard Time (no summer/winter time change) as a saved value in an SQL database in my application. Those values are than displayed as the local time of the viewer. I do this with a timezone database of my own making that predates the addition of the EsTimeZoneDatabase to VA Smalltalk. I would like to replace my timezone database with the EsTimeZoneDatabase so I don't have to keep maintaining it. So I have a good reason for using US Eastern Standard Time timezone to get the date/time value. What is the correct/proper EsTimeZoneDatabase US Eastern Standard Time timezone name to use?


On Saturday, August 23, 2014 8:51:27 AM UTC-4, Donald MacQueen wrote:
Hi Lou,

First, EST is ambiguous - it can be Eastern Standard Time (US) or Easter Summer Time (Australia). The tz data for EST has no DST transitions, and without them there is no offset. You can see that by inspecting EsTimeZoneDatabase timeZoneFor: 'EST'; the instance variable transitionTimeTable will be nil.  You generally want to stay away from /Etc timezones because they do not have DST transition data.

 You are correct that (EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset should be -04:00:00. I will look into that.

 I think the offset is "always" the same when asked with: (EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset >> -0:05:00:00
but shows as -4 when the time is obtained during the summer:

DateAndTime now: 'US/Eastern'.
2014-08-24T09:59:49.137-04:00

I think this is fine. My problem is in trying to obtain "Standard" for a timezone. I need US Eastern Standard Time but it looks like none of them work. That is why I looked at the /Etc timezones.

Thanks for looking into this.

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

dmacq


On Sunday, August 24, 2014 10:16:04 AM UTC-4, Louis LaBrunda wrote:
Hi Donald,

I use US Eastern Standard Time (no summer/winter time change) as a saved value in an SQL database in my application. Those values are than displayed as the local time of the viewer. I do this with a timezone database of my own making that predates the addition of the EsTimeZoneDatabase to VA Smalltalk. I would like to replace my timezone database with the EsTimeZoneDatabase so I don't have to keep maintaining it. So I have a good reason for using US Eastern Standard Time timezone to get the date/time value. What is the correct/proper EsTimeZoneDatabase US Eastern Standard Time timezone name to use?
 
US Eastern Standard Time is 'America/New_York'.




 I think the offset is "always" the same when asked with: (EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset >> -0:05:00:00 but shows as -4 when the time is obtained during the summer:

DateAndTime now: 'US/Eastern'.
2014-08-24T09:59:49.137-04:00
This                                       ^^^^^^ is correct.

(EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset >> -0:05:00:00
This                                                                                          ^^^^^^^^^^^ is not. But it will be.

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

Louis LaBrunda

Hi Donald,

We need to be a little careful when talking about this timezone stuff.  The offset displayed for a DateAndTime instance includes the adjustment for DST.  The offset displayed for an instance of EsTimeZoneRuleSet (from EsTimeZoneDatabase timeZoneFor:) seems to be the base offset without adjustment for DST.  I don't know if this is what it should do or not but I can understand if it is because the timezone info has a history of DST adjustments over the years and it uses the adjustment based upon the date/time being created for that timezone.  When we look at the timezone info a particular date/time is not involved so it would just show the base offset.

The problem I see is that all (I think it is all) timezones without a transitionTimeTable think they have a 0 offset instead I think they should have their base offset.  I expect this:

DateAndTime now: #GMT.

and this:

DateAndTime now: 'Etc\GMT-5'.

to give two different time about five (5) hours apart.  Instead they give the same time.

(DateAndTime now: #GMT) = (DateAndTime now: 'Etc\GMT-5')
true

Lou



On Monday, August 25, 2014 8:30:27 AM UTC-4, Donald MacQueen wrote:


On Sunday, August 24, 2014 10:16:04 AM UTC-4, Louis LaBrunda wrote:
Hi Donald,

I use US Eastern Standard Time (no summer/winter time change) as a saved value in an SQL database in my application. Those values are than displayed as the local time of the viewer. I do this with a timezone database of my own making that predates the addition of the EsTimeZoneDatabase to VA Smalltalk. I would like to replace my timezone database with the EsTimeZoneDatabase so I don't have to keep maintaining it. So I have a good reason for using US Eastern Standard Time timezone to get the date/time value. What is the correct/proper EsTimeZoneDatabase US Eastern Standard Time timezone name to use?
 
US Eastern Standard Time is 'America/New_York'.




 I think the offset is "always" the same when asked with: (EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset >> -0:05:00:00 but shows as -4 when the time is obtained during the summer:

DateAndTime now: 'US/Eastern'.
2014-08-24T09:59:49.137-04:00
This                                       ^^^^^^ is correct.

(EsTimeZoneDatabase timeZoneFor: 'US/Eastern') offset >> -0:05:00:00
This                                                                                          ^^^^^^^^^^^ is not. But it will be.

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

dmacq


On Monday, August 25, 2014 11:39:19 AM UTC-4, Louis LaBrunda wrote:

Hi Donald,

We need to be a little careful when talking about this timezone stuff.  The offset displayed for a DateAndTime instance includes the adjustment for DST.  The offset displayed for an instance of EsTimeZoneRuleSet (from EsTimeZoneDatabase timeZoneFor:) seems to be the base offset without adjustment for DST.  I don't know if this is what it should do or not but I can understand if it is because the timezone info has a history of DST adjustments over the years and it uses the adjustment based upon the date/time being created for that timezone.  When we look at the timezone info a particular date/time is not involved so it would just show the base offset.

Hi Lou,
 
Disagree. It should show the offset for the time zone rule that is currently in effect in the time zone.  That is the only thing that can be done with the tz data. The tz data contains only transitions; there is no concept of a 'base' offset.
 

The problem I see is that all (I think it is all) timezones without a transitionTimeTable think they have a 0 offset instead I think they should have their base offset.  I expect this:

DateAndTime now: #GMT.

and this:

DateAndTime now: 'Etc\GMT-5'.

to give two different time about five (5) hours apart.  Instead they give the same time.

(DateAndTime now: #GMT) = (DateAndTime now: 'Etc\GMT-5')
true


Try this version of offset and the above will be false:

EsTimeZoneRuleSet>>offset

    ^(DateAndTime now: (self name)) offset


The Etc time zones will show an offset when you use the above code, but they will not do DST transitions.  BTW, if you want a time zone with an unchanging offset of -5 (EST), use Etc\GMT+5. The sign is the reverse of the offset.

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

Louis LaBrunda
Hi Donald,

On Monday, August 25, 2014 4:03:44 PM UTC-4, Donald MacQueen wrote:


On Monday, August 25, 2014 11:39:19 AM UTC-4, Louis LaBrunda wrote:

Hi Donald,

We need to be a little careful when talking about this timezone stuff.  The offset displayed for a DateAndTime instance includes the adjustment for DST.  The offset displayed for an instance of EsTimeZoneRuleSet (from EsTimeZoneDatabase timeZoneFor:) seems to be the base offset without adjustment for DST.  I don't know if this is what it should do or not but I can understand if it is because the timezone info has a history of DST adjustments over the years and it uses the adjustment based upon the date/time being created for that timezone.  When we look at the timezone info a particular date/time is not involved so it would just show the base offset.

Hi Lou,
 
Disagree. It should show the offset for the time zone rule that is currently in effect in the time zone.  That is the only thing that can be done with the tz data. The tz data contains only transitions; there is no concept of a 'base' offset.

I will take your word for that but then how do you explain that all the 'Etc\GMT-n' and 'Etc\GMT+n' have the same offset of 0:00:00:00.  What good are those timezones (with different names that look like offsets from GMT) if they all have the same offset and all give the same time?

Lou
 

The problem I see is that all (I think it is all) timezones without a transitionTimeTable think they have a 0 offset instead I think they should have their base offset.  I expect this:

DateAndTime now: #GMT.

and this:

DateAndTime now: 'Etc\GMT-5'.

to give two different time about five (5) hours apart.  Instead they give the same time.

(DateAndTime now: #GMT) = (DateAndTime now: 'Etc\GMT-5')
true


Try this version of offset and the above will be false:

EsTimeZoneRuleSet>>offset

    ^(DateAndTime now: (self name)) offset


The Etc time zones will show an offset when you use the above code, but they will not do DST transitions.  BTW, if you want a time zone with an unchanging offset of -5 (EST), use Etc\GMT+5. The sign is the reverse of the offset.

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

dmacq
In reply to this post by Louis LaBrunda
Ignore this message if you are not having any GMT problems.

The solution to Lou's problem in using the Etc/Gmtn turned out to be data.  The latest version of the time zone data, from iana.org, is 2014f and is attached as a zip file.

Simply replace your <Varoot>/zoneinfo directory with the contents of this file.

This data will be shipped with our 8.6.1 release.



Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.

zoneinfo.zi (570K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Why does EST show an offset of 0 when it should be 5?

Louis LaBrunda
Hi Donald,

I meant to thank you sooner but stuff got in the way, so thanks for looking into this and helping me understand how the timezone info works.

Lou

On Thursday, August 28, 2014 1:46:10 PM UTC-4, Donald MacQueen wrote:
Ignore this message if you are not having any GMT problems.

The solution to Lou's problem in using the Etc/Gmtn turned out to be data.  The latest version of the time zone data, from <a href="http://iana.org" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fiana.org\46sa\75D\46sntz\0751\46usg\75AFQjCNGsZ0tUiNC3JdIXr0p_eCPbPwM90A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fiana.org\46sa\75D\46sntz\0751\46usg\75AFQjCNGsZ0tUiNC3JdIXr0p_eCPbPwM90A';return true;">iana.org, is 2014f and is attached as a zip file.

Simply replace your <Varoot>/zoneinfo directory with the contents of this file.

This data will be shipped with our 8.6.1 release.



Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.