Mysql time storage problem time front-end display xx minutes time is filled in by front-end how to save to the database and read ?, What type is a field type. Save the data in the corresponding type format. for example, DATExxxx-xx-xxDATETIMExxxx-xx-xxxx: xx: xxTIMExx: xx, $ s = '16: 48 minutes '; // $ s mysql time storage problems
How does the front-end display xx: xx minutes?
------ Solution --------------------
What type is a field type. Just save it to the corresponding type format.
Like DATE xxxx-xx
DATETIME xxxx-xx: xx
TIME xx: xx
------ Solution --------------------
$ S = '16 hours 48 minutes ';
// $ S = '16: 48 ';
Echo date ('H: I: S', strtotime (preg_replace ('/[^ \ d]/', '', $ s )));
Get 16:48:00
This is the data you need to write the time field
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