Re: 10.4 date format help
Re: 10.4 date format help
- Subject: Re: 10.4 date format help
- From: Steve Christensen <email@hidden>
- Date: Tue, 5 Dec 2006 13:03:06 -0800
That particular format (yyyy-mm-ddThh:mm:ssZ) is ISO 8601, which
normalizes the date/time so that it's expressed in terms of GMT. From
there you can convert to any other timezone you desire. The one thing
to point out is that if you stored - in your example -
"2006-12-05T18:00:00Z", that is interpreted as 6pm GMT, not 6pm EST.
It sounds like you're trying to store an EST value into the plist. Is
there any reason you couldn't store a standard GMT date/time and then
also include a separate field that contains the desired/source/
whatever timezone?
steve
On Dec 5, 2006, at 11:54 AM, Marc Respass wrote:
Thanks but I think you did misunderstand. If I have a date and want
to represent it as a string, I used to use a formatter and give it
@"%Y-%m-%d" or whatever and I get a string. But the XML plist
format uses the new ICU date format which looks like
2006-12-05T13:00:00Z and I'm trying to get that date/time in US
Eastern. From what I can tell, the way to do that is to set the
time so 1 AM is converted to GMT which is (I think) 6 AM so I need
my string to be 2006-12-05T18:00:00Z but I was really hoping for a
symbol at the end to designate the time zone and that doesn't seem
to be the case.
Thanks anyway. I can't say I like the ICU thing but at least now
I'm standards compliant :\
Marc
On Dec 5, 2006, at 2:46 PM, I. Savant wrote:
NSCalendarDate has a -setTimeZone: method, which is easily found
searching the documentation for "timezone" ... unless I
misunderstood what you're asking, that should work just fine.
--
I.S.
On Dec 5, 2006, at 2:17 PM, Marc Respass wrote:
Hi All,
I have not had any luck finding the information I need to format
a string according to the 10.4 ICU library style. I would happily
revert to the (easy to use) 10.3 style but I am building an XML
plist that has a date type. I need the time to stay in my time
zone but I can't find any information for how to format the date
string. A plist gets this format
2006-12-05T13:00:00Z
and I can't find the information I need to set the time zone. As
far as I can tell, the time zone is represented by the time so
that date string means 1PM GMT and I would need to change the
time to be US Eastern. If that is true, then it's a drag, and I
guess the only choice is to do addition on the time to get it
into my zone but that sucks a lot. Does anyone know of a way to
set the time zone in an XML plist <date> element?
Thanks a lot
Marc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden