Users Pricing

forum

home / developersection / forums / how to print nsdate using nslog?

How to print NSDate using NSLog?

marcel ethan 1763 06 Dec 2015

I want to print NSDate in NSLog, but its not printing date correctly.

NSDateFormatter *format = [NSDateFormatter new];
[format setDateFormat: @"YYYY-MM-DD"];
NSDate *date = [NSDate date];
NSLog(@"Date: %@",format);

Can anyone tell me, what's wrong in my code..!


marcel ethan

Other


1 Answers

Tarun Kumar 07 Dec 2015 Accepted Answer