Question

I'm sure this is a easy problem, but I just can not seem to find how to do this anywhere. I need to use the current Date and save it into a String. I do not know how to get the dat stamp. Could someone please help me out? Thank you for your time! -Jeff

Was it helpful?

Solution

You will need to set your format according to the docs

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM-dd-yy"];
NSString *date = [formatter stringFromDate:[NSDate date]];

OTHER TIPS

Use NSDateFormatter, heres a link with examples

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top