gmt
MySQL query for current GMT time
Just use UTC (doesnt get affected with daylight savings time) SELECT UTC_TIMESTAMP(); Old Content for reference: this should work, but with SELECT CONVERT_TZ(NOW(),’PST’,’GMT’); i got also NULL as result. funny enough the example in the mysql docu also returns null SELECT CONVERT_TZ(‘2004-01-01 12:00:00′,’GMT’,’MET’); http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz seems you found a bug in mysql. (thanks to +Stephen Pritchard) … Read more
Converting date between timezones swift
Simpler version: extension Date { func convertToTimeZone(initTimeZone: TimeZone, timeZone: TimeZone) -> Date { let delta = TimeInterval(timeZone.secondsFromGMT(for: self) – initTimeZone.secondsFromGMT(for: self)) return addingTimeInterval(delta) } }
NSTimeZone: Any difference between “UTC” and “GMT”?
According to the docs, CFTimeZone (and by extension, NSTimeZone) uses time zone names, abbreviations, GMT offset, and DST information from the TZ (or “Olsen”) Database. Looking at the source, you’ll see that while semantically “GMT” and “UTC” are quite distinct, in practice they’re no different: “GMT” is just a zero offset timezone. Update: While this … Read more
Get GMT Time in Java
Odds are good you did the right stuff on the back end in getting the date, but there’s nothing to indicate that you didn’t take that GMT time and format it according to your machine’s current locale. final Date currentTime = new Date(); final SimpleDateFormat sdf = new SimpleDateFormat(“EEE, MMM d, yyyy hh:mm:ss a z”); … Read more
UNIX timestamp always in GMT?
yep, UNIX timestamp represents how much seconds past from unix-time epoch in GMT+0
Difference between UTC and GMT Standard Time in .NET
GMT does not adjust for Daylight saving time (DST). You can hear it from the horse’s mouth on this web site. Add this line of code to see the source of the problem: Console.WriteLine(TimeZoneInfo.FindSystemTimeZoneById(“GMT Standard Time”).SupportsDaylightSavingTime); Output: True. This is not a .NET problem, it is Windows messing up. The registry key that TimeZoneInfo uses … Read more
NSDate – Convert Date to GMT
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @”yyyy-MM-dd’T’HH:mm”; NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@”GMT”]; [dateFormatter setTimeZone:gmt]; NSString *timeStamp = [dateFormatter stringFromDate:[NSDate date]]; [dateFormatter release];