Last active
August 29, 2015 14:16
-
-
Save Eridana/7caa3ffe8719e5f210a3 to your computer and use it in GitHub Desktop.
Generate random unique string value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTimeInterval today = [[NSDate date] timeIntervalSince1970]; | |
NSString *intervalString = [NSString stringWithFormat:@"%f", today]; | |
NSDate *date = [NSDate dateWithTimeIntervalSince1970:[intervalString doubleValue]]; | |
NSDateFormatter *formatter=[[NSDateFormatter alloc]init]; | |
[formatter setDateFormat:@"yyyyMMddhhmm"]; | |
NSString *strValue = [formatter stringFromDate:date]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment