NSDate returns wrong date on the first of month
My app used [NSDate date ] function to get current date. Its work fine other days except 1st of every month during AM . i.e Follow Following steps : Set the system date as 01 - June - 2011 & time between 00.00 midnight to 5.59 AM. Use following code : NSLog(@"Current Date :: %@",[NSDate date]); The O/P is :: Current Date :: 2011-05-31 19:40:21 +0000 Desired O/P is :: Current Date :: 2011-06-01 00:00:0( i.e.the time which is set ) +0000 Also From 6 AM it works fine. What is reason for this? Actually I don't want NSDate in string format but what I want is NSDate date object corresponding to 1st