Skip to content

Instantly share code, notes, and snippets.

@Eridana
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save Eridana/7caa3ffe8719e5f210a3 to your computer and use it in GitHub Desktop.

Select an option

Save Eridana/7caa3ffe8719e5f210a3 to your computer and use it in GitHub Desktop.

Revisions

  1. Eridana renamed this gist Feb 27, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Eridana created this gist Feb 27, 2015.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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];