langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
3
Task/Date-format/Objective-C/date-format-1.m
Normal file
3
Task/Date-format/Objective-C/date-format-1.m
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
NSLog(@"%@", [NSDate date]);
|
||||
NSLog(@"%@", [[NSDate date] descriptionWithCalendarFormat:@"%Y-%m-%d" timeZone:nil locale:nil]);
|
||||
NSLog(@"%@", [[NSDate date] descriptionWithCalendarFormat:@"%A, %B %d, %Y" timeZone:nil locale:nil]);
|
||||
7
Task/Date-format/Objective-C/date-format-2.m
Normal file
7
Task/Date-format/Objective-C/date-format-2.m
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
NSLog(@"%@", [NSDate date]);
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormat alloc] init];
|
||||
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
|
||||
NSLog(@"%@", [dateFormatter stringFromDate:[NSDate date]]);
|
||||
[dateFormatter setDateFormat:@"EEEE, MMMM d, yyyy"];
|
||||
NSLog(@"%@", [dateFormatter stringFromDate:[NSDate date]]);
|
||||
[dateFormatter release];
|
||||
Loading…
Add table
Add a link
Reference in a new issue