Tom
Tom

Reputation: 1651

GMT vs UTC dates

I have a calendar built in JavaScript that compares dates with PHP. The JavaScript date object is set using PHP, but, when I compare future dates, they appear to be out of sync.

PHP is set to GMT and JavaScript is set to UTC; how do these standards differ, and could this be causing the problem?

Upvotes: 40

Views: 13589

Answers (4)

apokryfos
apokryfos

Reputation: 40653

If you strictly go by the definition of what UTC and GMT are, there is no real practical difference as others have pointed out.

However one needs to be careful as there are certain cases where (possibly legacy) terminology is used such as in the Microsoft Timezone index values

The difference is that in that context, what is referred to as the "GMT timezone" (code 55) is, in reality, the "GMT locale" which is the locale used by Dublin, Edinburgh, Lisbon, London (all of which observe daylight savings time) which is differentiated from Greenwich Standard Time (code 5A) which is used by Monrovia and Reykjavik both of which do not observe daylight savings time.

The practical difference is that if a system is set up to use UTC (code 80000050 under the semantics specified above) then it will not automatically switch to daylight savings time while if you set your time zone to GMT (code 55) then there's a good chance it automatically switches to BST during the summer without you noticing.

Upvotes: 0

Jasen
Jasen

Reputation: 12392

For computers, GMT is UTC+0 - so they are the equivalent.

Upvotes: 1

Ben James
Ben James

Reputation: 125137

One is measured from the sun and another from an atomic clock.

For your purposes, they are the same.

Upvotes: 35

user151323
user151323

Reputation:

From Coordinated Universal Time on Wikipedia:

Coordinated Universal Time (UTC) is a time standard based on International Atomic Time (TAI) with leap seconds added at irregular intervals to compensate for the Earth's slowing rotation.

From Greenwich Mean Time on Wikipedia:

UTC is an atomic time scale which only approximates GMT with a tolerance of 0.9 second

Upvotes: 37

Related Questions