Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need information on printing [NSDate date]

Tags:

ios

nsdate

When I am printing the date

//getting the current date and time
self.date = [NSDate date];
NSLog(@"%@",date);

The date which I am getting is correct, but there is a delay in time by 6 hrs. My system time is correct.

like image 557
Ramgopal Avatar asked Nov 21 '12 05:11

Ramgopal


1 Answers

try this

NSLocale* currentLoc = [NSLocale currentLocale];
NSLog(@"%@",[[NSDate date] descriptionWithLocale:currentLoc]); 
like image 188
Pratyusha Terli Avatar answered Oct 03 '22 14:10

Pratyusha Terli