Seems like a simple thing but I can't seem to find a way to do it.
It would be great to see a couple different methods.
Thanks,
Nick
Seems like a simple thing but I can't seem to find a way to do it.
It would be great to see a couple different methods.
Thanks,
Nick
Use [NSDate dateWithString:@"YYYY-MM-DD HH:MM:SS ±HHMM"], where +-HHMM is the timezone offset. There is a very good reference of NSDate over at Mac Dev Center ;)
See the documentation for NSDate. You can use the dateFromString:
method of NSDateFormatter
or the dateFromComponents:
method of NSCalendar
.
If you're talking about a specific calendar date rather than a UNIXy date, you probably want NSCalendar's dateFromComponents:
.