Display either date part or time part in LOCAL format
Display either date part or time part in LOCAL format
- Subject: Display either date part or time part in LOCAL format
- From: Jacob Rhoden <email@hidden>
- Date: Sun, 05 Jul 2009 17:21:57 +1000
I am probably overlooking something obvious (I hope) but what is the
proper way to convert. either the Date or Time part of an NSDate to a
localised string? I know I can do the following but its not exactly
localised :(
NSDate *now = [[NSDate alloc] init];
NSDateFormatter *localDate = [[NSDateFormatter alloc] init];
[localDate setDateFormat:@"yyyy-MM-dd"];
NSString *date = [localDate stringFromDate:now];
NSDateFormatter *localTime = [[NSDateFormatter alloc] init];
[localTime setDateFormat:@"HH:mm:ss"];
NSString *time = [localTime stringFromDate:now];
--
____________________________________________
Jacob Rhoden http://jacobrhoden.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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