Jump to content

Time


oddim

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.