when i was attempting the challenge, i notice that the hour that i set is different from when the one i set. After investigation, i noticed it differs from the timezone i and in. Currently, i am in a +8 GMT/UTC time zone.
i wrote the following code
[code]NSDateComponents *comps = [[NSDateComponents alloc]init];
NSCalendar *g = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *dateOfBirth = [g dateFromComponents:comps]; NSLog(@"Birthdate is %@",dateOfBirth);
This is the output of NSLog.
“Birthdate is 2014-03-31 00:00:00 +0000”
I am wondering how do i change the timezone to my local time zone.