mysql时间存储问题
时间前台显示 xx时xx分 时间是前台填写的 怎么存进数据库和读取?
------解决方案--------------------
有字段类型是什么类型啊。存成对应的类型格式就好了啊
像DATE xxxx-xx-xx
DATETIME xxxx-xx-xx xx:xx:xx
TIME xx:xx:xx
------解决方案--------------------
$s = '16时48分';
//$s = '16:48';
echo date('H:i:s' , strtotime(preg_replace('/[^\d]/', '', $s)));
得到 16:48:00
这就是你需要写入 time 类型字段的数据
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号