内容简介:翻译自:https://stackoverflow.com/questions/3092558/how-do-i-convert-12-hour-clock-time-into-24-hour-clock-time-in-php
我正在使用以下功能,我想要24小时时钟格式的时间,但这给了我12小时的时间:
<?php
date_default_timezone_set('Asia/Kolkata');
$timestamp = date("d/m/Y h:i:s", time());
print $timestamp ;
?>
我究竟做错了什么?
date()
:H格式字符以24小时格式给出小时.此外,如果您不希望在中午前几小时领先0,您可以使用G.
示例(如果当前时间是七分之一AM)
date(‘H:i:s’) – > “7点22分13秒”
date(‘G:i:s’) – > “7点22分13秒”
对于您的具体情况:
$timestamp = date("d/m/Y H:i:s", time());
翻译自:https://stackoverflow.com/questions/3092558/how-do-i-convert-12-hour-clock-time-into-24-hour-clock-time-in-php
以上所述就是小编给大家介绍的《如何在PHP中将12小时时间转换为24小时制?》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- python中将list转为dict
- Spring中将header头转换为参数
- 数组 – 如何在Swift中将数组拆分成两半?
- postgresql – 在postgres中将表列名更改为大写
- 如何在Java 8中将List转换为Map?
- 如何在Kubernetes中将Envoy用作负载均衡器
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Neural Networks for Applied Sciences and Engineering
Samarasinghe, Sandhya / CRC Pr I Llc / 2006-9 / $ 118.59
In response to the exponentially increasing need to analyze vast amounts of data, Neural Networks for Applied Sciences and Engineering: From Fundamentals to Complex Pattern Recognition provides scient......一起来看看 《Neural Networks for Applied Sciences and Engineering》 这本书的介绍吧!