此问题在此处已有答案:
Getting date format m-d-Y H:i:s.u from milliseconds(18回答)
昨天关门了。
我正试图与一些VB代码集成,这些代码使用
第一个月
在PHP中我能得到的最接近这个的是date('YmdHis')
个
但这个缺少毫秒,
我试过用microtime
玩。date('YmdHis',time()).substr(str_replace(".","",microtime(true)),10,17)
个
但有时这会导致更短的字符串
1条答案
按热度按时间4bbkushb1#
date
函数总是在微秒内返回零。使用DateTime -> format并将最后两位数字砍掉,以便留下4个小数位。字符串