lördag 13 november 2010

Dates! Pah!

The following does not compile and several lines are mutually exclusive/contradictive.

Have a nice day.

NSArray* array = [NSLocale availableLocaleIdentifiers];
NSUInteger i = [array count];
NSUInteger j = 0;
for (j = 0; j
NSLog((NSString*)[array objectAtIndex:j]);
}


NSDate *today = [NSDate date];
//unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
NSDateFormatter *frm = [[NSDateFormatter alloc] init];
[frm setDateFormat:@"EEE MMM dd 'huhu' HH:mm:ss ZZZ yyyy"];
[frm setTimeStyle:NSDateFormatterFullStyle];
[frm setDateStyle:NSDateFormatterFullStyle];

NSLocale *en_US = [[NSLocale alloc] initWithLocaleIdentifier:@"es"];
[frm setLocale:en_US];

NSString *currentTime = [frm stringFromDate:today];
NSLog(@"Time: :%@",currentTime);