Re: creating NSCalendarDate with a specific time zone
Re: creating NSCalendarDate with a specific time zone
- Subject: Re: creating NSCalendarDate with a specific time zone
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 11 May 2006 17:42:04 -0700
On May 11, 2006, at 2:47 PM, stephen joseph butler wrote:
I'm working with LDAP and I would like to create an NSCalendarDate
with an LDAP timestamp. The format of LDAP timestamps is
"%Y%m%d%H%M%SZ" (or "YYYYmmddHHMMSSZ"). The 'Z' on the end is the
military code for GMT.
My problem: how do I create an NSCalendarDate with the proper time
zone set? Nothing in the format strings (that I've read) indicates
that it can handle the single letter time zones. I'm not really
worried about supporting zones other than Z/GMT, so if I could create
NSCalendarDates in only that time zone then I'd be happy. What I can't
do, however, is change the default time zone.
Suggestions? I'm surprised that NSCalendarDate doesn't have a
dateWithString:calendarFormat:timeZone: message.
The time zone is part of the format string...
date = [NSCalendarDate
dateWithString:[dateString stringByAppendingString:@" GMT"]
calendarFormat:@"%Y%m%d%H%M%SZ %Z"];
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden