我设法将mysql时间戳格式化为英国日期格式,但不知道如何计算时间。
这是代码:
<b><?php echo date("d F Y",strtotime($row['notedate']));?></b><br>
此输出
13 December 2015
以上是完美的英国格式,但我怎样才能包括时间?
感谢。
答案 0 :(得分:0)
扩展评论中的其他答案,如果您使用H:i:s将打印出来
16:23:12
例如,您可以使用am / pm,因为英国大多数人更喜欢这种时间格式(我相信),这将是:
date("d F Y g:i A",strtotime($row['notedate']));
给你:
13 December 2015 05:58 AM
可以找到所有不同的时间和日期格式here