about how the 24-hour timekeeping system is converted into a am/pm format

Source: Internet
Author: User
Tags echo date
How does the 24-hour timekeeping system convert to AM/PM format?
Date 24-hour chronograph date am/pm
2008-08-02 00:00:00?
2008-08-02 00:00:01?
2008-08-02 00:59:59?
2008-08-02 01:00:00?
2008-08-02 01:00:01?
2008-08-02 11:59:59?
2008-08-02 12:00:00?
2008-08-02 12:00:01?
2008-08-02 12:59:59?
2008-08-02 13:00:00?
2008-08-02 13:00:01?
2008-08-02 23:00:00?
2008-08-02 23:00:01?
2008-08-02 23:59:59?

And there's no universal function or anything?

------Solution--------------------
Hours to take the remainder.
Module 0 is am mode 1 for PM

------Solution--------------------
JS or PHP?

------Solution--------------------
Mind using UNIX Timestamp
Date with the Date function (' A ', Time ())
------Solution--------------------
Slow, huh?

ls right.

echo Date (' y-m-d h:i:s a ', Strtotime (' 2008-08-02 00:00:00 '));

------Solution--------------------
UPDATE table
SET 24-hour timekeeping = IF (left (24 hour timekeeping, 2) > 12,
CONCAT (Left (24-hour chronograph, 2) -12, right (24-hour chronograph, 6)),
24-hour timekeeping system),
t = IF (left (24 hour chronograph, 2) >, ' am ', ' pm ');
  • Related Article

    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.