Answer by JNYJ for Converting [NSDate date] to a localized UTC date string
public let Date_format_Default:String = "yyyy-MM-dd HH:mm:ss"Set this format string for UTC string;public let Date_format_Z:String = "yyyy-MM-dd HH:mm:ssZ"public let Time_zone_UTC:String = "UTC"open...
View ArticleAnswer by iBug for Converting [NSDate date] to a localized UTC date string
NSDate *currentDate = [NSDate date];Now it is in UTC, (at least after using the method below)To store this time as UTC (since refernce date 1970) usedouble secsUtc1970 = [[NSDate...
View ArticleAnswer by rmaddy for Converting [NSDate date] to a localized UTC date string
There is no need for any timezone manipulation.NSTimeInterval interval = [[NSDate date] timeIntervalSince1970];NSString *dateStarted = [NSString stringWithFormat:@"/Date(%.0f)/", interval * 1000];This...
View ArticleConverting [NSDate date] to a localized UTC date string
I have an NSDate object that I am sending to an API that we use. Our app is used across the world, so the API is wanting the date to be in UTC, e.g.:"/Date(1481704200000)/"However, the date needs to...
View Article
More Pages to Explore .....