PHP+MYSQL如何存储和读取格式化时间

WBOY
Release: 2016-06-13 11:51:46
Original
834 people have browsed it

PHP+MYSQL怎么存储和读取格式化时间。
注:只需要存储、读取和判断时间,不包括日期。。

开始时间:08:30:00
结束时间:18:00:00
在表单中输入如上格式的时间,可否用int类型存储到MYSQL数据库,又怎么用PHP读取打印出来?
并且可以判断服务器当前时间是否处于开始和结束之间。
------解决方案--------------------

$current = date("H:i:s");<br />if( $current >$time1 && $current < $time2){<br />     echo '之间';<br />}else{<br />     echo '非之间';<br />}
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!