NSDate* date = [NSDate date];
NSLog(@"datad %@",date)
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
NSLocale *enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
[formatter setLocale:enUSPOSIXLocale];
[formatter setDateFormat:@"hh:mm a"];
NSString* str = [formatter stringFromDate:date];
NSLog(@"str %@",str);
Comments
Post a Comment