Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
- Subject: Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
- From: Ken Anderson <email@hidden>
- Date: Fri, 9 Jan 2009 10:23:53 -0500
Bardi,
I think the most important thing to understand about how dates are
moved around is that the value is always GMT based. Timezones are
there for convenience...
For instance, when you create a new timestamp with a timezone, the
timezone is used to adjust the date/time you sent in to GMT and the
GMT value is stored. When formatting a date or extracting day/month/
year from GregorianCalendar, the timezone is used WHEN FORMATTING THE
RESULT.
If you work with these tenets, things will hopefully be easier.
Ken
On Jan 8, 2009, at 6:54 PM, Lachlan Deck wrote:
On 09/01/2009, at 3:10 AM, Ken Anderson wrote:
I do exactly what you're doing all the time, and I do not have the
issue you're experiencing. One thing I do at the beginning of my
WOApplication subclass is this:
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
NSTimeZone.setDefault(TimeZone.getTimeZone("GMT"));
This will make sure that you're really working in GMT across the
board. Can you do the above and try your tests again?
Yep.
Behaves correctly - no way
Yes way :-)
NSTimestamp reports a timezone which is not used by
GregorianCalendar ??
GregorianCalendar does *not* change its timezone based on the date
passed to it. You are responsible for determining that. That's
nothing to do with NSTimestamp.
This is a difficult bug.
Just more a misunderstanding on your part.
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden