In Google App Engine, I have a datetime property with (auto_now_add=True). In Objective-C on my iPhone, getting the current time gets me 2012-04-17 6:55:01 while on Python the auto_now_add got me 2012-04-17 11:55:01.
6:55 is my local time, and I’m not sure what time zone or format the Python date is in. How do I get both to match, either through Python or through Objective-C?
Edit: So apparently the Python date is in UTC format. But what format is my iPhone date in? I thought [NSDate date] is also in UTC? Why am I getting different results?
Edit 2: Ok got it. Needed to do this in Objective-C
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
[formatter setTimeZone:timeZone];
This is because the app engine always works in UTC time, your phone is probably in a different timezone.
Source