Format the current time as an NSString

/ Published in: Objective C
Save to your folder(s)

Copy this code and paste it in your HTML
  1. NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
  2. [dateFormat setDateFormat:@"HH:mm:ss"];
  4. NSDate *now = [[NSDate alloc] init];
  6. NSString* timeString = [dateFormat stringFromDate:now];
  7. [dateFormat release];
  8. [now release];

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.