0

Up until today and the release 8.0.2 I have been using,

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddhhmmss"];
NSString *keyDate = [dateFormatter stringFromDate:[NSDate date]];

and have been getting the result: 20140926125522.

But after the update I am now getting: 2014092612:55:22.

I am then unable to convert the keydate to a NSNumber as it now contains :.

Is anyone else getting this?

** EDIT **

After reading the comments i decided to go into the device settings and in the time and settings section turned the Set Automatically to off and the issue went away. I then turned it back on and the issue did not reappear.

Thanks for all the help.

1 Answers1

0

An immediate fix could be the following:

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddhhmmss"]; 
NSString *keyDate = [dateFormatter stringFromDate:[NSDate date]];
keyDate = [keyDate stringByReplacingOccurrencesOfString:@":" withString:@""];

This is not a solution however and should be fixed by apple in upcoming release

EDIT

I just checked in iPhone 4s with 8.0.2 (12A405) and can't reproduce the problem , using XCode 6.1 beta 2. it produces desired output

Printing description of keyDate:
20140926061051

EDIT 2

Checked in two other devices , same result, so i can say it is not an apple bug

Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64