Jump to content

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
https://forums.phpfreaks.com/topic/208802-time/#findComment-1090824
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
https://forums.phpfreaks.com/topic/208802-time/#findComment-1091169
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.