• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Bug ID 6342679: NSTimestamp Happy New Year Bug
      • From: Barði Einarsson <email@hidden>
References: 
 >Bug ID 6342679: NSTimestamp Happy New Year Bug (From: Barði Einarsson <email@hidden>)
 >Re: Bug ID 6342679: NSTimestamp Happy New Year Bug (From: Ken Anderson <email@hidden>)
 >Re: Bug ID 6342679: NSTimestamp Happy New Year Bug (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
  • Next by Date: Re: WebObjects jar frameworks and classpaths
  • Previous by thread: Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
  • Next by thread: Bug ID 6342679: NSTimestamp Happy New Year Bug
  • Index(es):
    • Date
    • Thread