手册地址:http://php.net/manual/en/dateinterval.format.php $january = new DateTime('2010-01-01'); $february = new DateTime('2010-02-01'); $interval = $january->diff($february); // %a will output the total number of days. echo $interval->format('%R%a tota…
.NET中DateTime.Now.ToString显示毫秒:DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") DateTime.Now.ToString的其他格式化字符串: 格式化字符串 释义 示例 D long date Thursday, 10 April 2008 d short date 04/10/2008 F full date long Thursday, 10 April 2008 06:30:00 f full d…