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
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.