NSDate *currentDate = [NSDate date];
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"MM/dd/yyyy,h,mm,a"];
NSString *dateString = [format stringFromDate:currentDate];
[format release];
NSLog(dateString);
Output in: Device iPhone4
[240:707] 10/25/2011,22,23,
Current language: auto; currently objective-c
warning: Unable to read symbols for /SDK4.2/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib
Output in: Device iPad2
[82:707] 10/25/2011,12,28,PM
Current language: auto; currently objective-c
warning: Unable to read symbols for /SDK4.2/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib
This thing works fine on Simulator for all.
How to handle this?
More Info:
it is also to notice that the same formatting string resulting in 12 hr and 24 hr clock values in return
finally resolved it.
it was due to the settings in phone as 24 Hr clock.
I had to update my code accordingly.
🙂