UNIX timestamp Conversion Problems

Source: Internet
Author: User

UNIX timestamp conversion problems company projects need to query databases far away from the United States, while the database stored over there is stored in the local timestamp. When querying data, a problem occurs, if a date like query is different from a UNIX timestamp query result, how can this time difference be processed? First, we need to understand two concepts: Date and UNIX timestamp. The date is sometimes differentiated. For example, here we are 23:33:23 and the date in the United States is: 10:33:23, that is, the United States uses the time zone (West five) 13 hours later than the GMT +. The UNIX timestamp refers to the number of seconds that have elapsed since January 1, January 1, 1971. There is no time zone difference, that is, the timestamp at a certain time point is globally unified. For example, if our timestamp is 1000000, our date is 23:33:23, and the U.S. timestamp is 1000000, and their date is 10:33:23, to wait until their date is 23:33:23, the timestamp will be: 1000000 + 3600*13, therefore, we need to add the time stamp of the 13-hour difference when we query the date here, instead of subtracting it.

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.