Difference between CST and GMT

Source: Internet
Author: User
Tags cst time time zones
Problem description
Today, I encountered a strange problem. on the server side, the current time obtained through Java is Fri Aug 28 09:37:46 CST 2009, which is converted to GMT at: 28 Aug 2009 01:37:46 GMT, that is to say, the GMT time plus 8 hours equals to the time indicated by CST. Isn't this CST Beijing time because we are in the GMT zone.

Everything looks normal, but there is a problem at the client's time for parsing with javascript:

 
// Fri Aug 28 2009 23:37:46 GMT + 0800 new date ('fri Aug 28 09:37:46 CST 2009 '). tostring ();

How strange is the difference between the time expressed in GMT and CST 14 hours?

Baidu

Find this article and the problem is clear.

GMT (Greenwich Mean Time) represents Greenwich Mean Time, which everyone knows.
However, CST can represent the following four different time zones:

    • Central Standard Time (USA) UT-6: 00
    • Central Standard Time (Australia) ut + 9: 30
    • China Standard time ut + 8: 00
    • Cuba Standard Time UT-4: 00

It can be seen that CST can also represent the standard time of the four countries in the United States, Australia, China, and Cuba.

The CST time obtained through Java previously uses the China Standard Time, while the client JavaScript uses the Central Time of the United States by default.

So the fri Aug 28 09:37:46 CST 2009 plus 6 hours, plus 8 hours, is equivalent to Fri Aug 28 2009 23:37:46 GMT + 0800

It can be seen that in future programming, in order to avoid errors, do not use CST time, but try to use GMT time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.