Sorry !! Time stamp converted to time error php

Source: Internet
Author: User
I recently wrote an api and I haven't found any problems during the test. However, after going online, you may find that the api returns incorrect results. Why? The caller gave two call examples. Theoretically, the two results should be consistent, but the actual results are inconsistent. The api call includes a timestamp parameter date. By converting a date to a time format, I find that

I recently wrote an api and I haven't found any problems during the test. However, after going online, you may find that the api returns incorrect results. Why? The caller gave two call examples. Theoretically, the two results should be consistent, but the actual results are inconsistent. The api call includes a timestamp parameter date. By converting a date to a time format, I find that

I recently wrote an api and I haven't found any problems during the test. However, after going online, you may find that the api returns incorrect results. Why?

The caller gave two call examples. Theoretically, the two results should be consistent, but the actual results are inconsistent.

The api call includes a timestamp parameter date. By converting the date to the time format, I found that the date is different from the original time after it is converted into time, which leads to an error.

I told the contact that your parameter is incorrect.

But that guy insisted that he was correct, and the time zone was the same. I'm a best friend.

It is mainly because you are too confident in yourself and are not aware of the error when the timestamp is converted to time.

I turned it like this.

$ Date = date ("Y-m-d h: I: s", $ date );

Memory in this format is YYYY-MM-DD HH: II: SS, in fact not, h is a 12-hour system.

This is correct.

$ Date = date ("Y-m-d H: I: s", $ date );

Sorry !!!!

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.