In Objective C and iOS , Some times you need to create a time stamp(Unix Time Stamp Style) you use like this :
NSString * timeStampValue = [NSString stringWithFormat:@"%d", (long)[[NSDate date] timeIntervalSince1970]];
NSLog(@"Time Stamp Value == %@", timeStampValue);
/*
Explain:
This translates to current server time of 04/13/2012 @ 8:41am in EST.
TIME
STAMP:
1334320615
DATE (M/D/Y @ h:m:s):
04 / 13 / 12 @ 7:36:55am EST
*/
========================
Output : 1334320615
========================
Comments
Post a Comment