Re: 10.4 date format help
Re: 10.4 date format help
- Subject: Re: 10.4 date format help
- From: Marc Respass <email@hidden>
- Date: Tue, 5 Dec 2006 16:39:32 -0500
Hi Steve,
Thanks for the official answer on what I was thinking was true. At
least that's out of the way :)
The reason I can't just convert it is mainly because of the "pita"
that would be. I get this XML document and I have to display its
contents as a list in a tableview. I have a style sheet that converts
the xml into an xml plist. The document that I get has Date and Time
in two different fields. If I can get the right format, then I can
convert to an XML plist using a <date> element and then I can apply a
formatter to my table cell and get a nice display. So I'm starting
with text. I don't have an object that I can represent as text, I
have text that I want to be the correct format, and I'm in the
Eastern US so that's the time zone I want to use. I could get an
object from the XML plist and go through the values of the dictionary
changing them to the correct time zone I suppose but I was sorta
hoping for a better date format. The problem with the reduced format
is that I have to do the math to get into the correct zone instead of
just appending the code for the time zone.
thanks to everyone for your help
Marc
On Dec 5, 2006, at 4:03 PM, Steve Christensen wrote:
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
_______________________________________________
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