oddim Posted July 25, 2010 Share Posted July 25, 2010 Can someone explain the differences between UTC, and GMT? Why is it so important in programming? Quote Link to comment Share on other sites More sharing options...
haku Posted July 25, 2010 Share Posted July 25, 2010 UTC generally isn't used in programming. GMT is the base time, and all other timezones are calculated from that. For example, I am at GMT + 900. Right now it is 15:09 in my time zone. Since I am +900, it is 06:09 at GMT. The time in all other time zones can be compared to that. This is important in programming because if you want to display times relative to someone's local timezone in this world wide internet, you need to be able to calculate the time where the original poster was, where the server is, and where the reader is, so that the appropriate time is shown. For example, unless you happen to be in the same time zone as myself, the time shown on this post will not be 15:12 (which it will be here when I finish posting). It will show the local time where you are (assuming you have set your timezone in your control panel) for when this post was made. Quote Link to comment Share on other sites More sharing options...
haku Posted July 25, 2010 Share Posted July 25, 2010 Sorry I forgot the difference between GMT and UTC. UTC adjusts for leap seconds. GMT is the adjusted time. GMT will always be the actual current time. UTC determines when that current time needs an adjustment for leap seconds. Quote Link to comment Share on other sites More sharing options...
oddim Posted July 25, 2010 Author Share Posted July 25, 2010 I heard UTC replaced GMT? Is that true? Also, why in Javascript do they have UTC functions if GMT is the same as UTC? Sorta pointless right? Sorry for these type of questions, I always been a little confused in this area of information. Quote Link to comment Share on other sites More sharing options...
haku Posted July 25, 2010 Share Posted July 25, 2010 Deleted Quote Link to comment Share on other sites More sharing options...
haku Posted July 25, 2010 Share Posted July 25, 2010 Read this: http://en.wikipedia.org/wiki/Coordinated_Universal_Time Quote Link to comment Share on other sites More sharing options...
oddim Posted July 25, 2010 Author Share Posted July 25, 2010 Basically UTC is more accurate than GMT, because UTC uses satellites and other things to add seconds at irregular intervals to make up for the earths slowing rotation? Quote Link to comment Share on other sites More sharing options...
oddim Posted July 25, 2010 Author Share Posted July 25, 2010 If GMT is just fine for programming use, than why does Javascript mostly have UTC methods? They sorta force you to work with UTC... I'm confused :/ Quote Link to comment Share on other sites More sharing options...
haku Posted July 26, 2010 Share Posted July 26, 2010 There is no 'mostly' about it - they offer UTC time as well as local time which can be converted to GMT time. Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 26, 2010 Share Posted July 26, 2010 Greenwich Mean Time (GMT) is a term originally referring to mean solar time at the Royal Observatory in Greenwich, London. It is the same as Coordinated Universal Time (UTC)... http://en.wikipedia.org/wiki/Greenwich_Mean_Time JavaScript time functions include functions that do not include GTM or UTC in their name. in those instances the time is simply the time from the computer running the code, whereas the UTC functions will return the UTC/GMT time. The one exception are the two functions: toGMTString() and toUTCString() which I believe are causing your confusion. They are simply the same function under different names. According to several sources, the toGMTString() function is Deprecated. Use the toUTCString() method instead http://www.w3schools.com/jsref/jsref_obj_date.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.