开发者

I am trying to convert a date/time string in PHP

开发者 https://www.devze.com 2023-01-11 09:41 出处:网络
I am开发者_Go百科 trying to convert a date/time string in this format YYYY/MM/DD/HH:MM:SS to a format that is recognized in PHPif it\'s exactly that, just do strtotime(substr($mydate,0,10).\" \".sub

I am开发者_Go百科 trying to convert a date/time string in this format

YYYY/MM/DD/HH:MM:SS

to a format that is recognized in PHP


if it's exactly that, just do strtotime(substr($mydate,0,10)." ".substr($mydate,-8)) which converts it to "YYYY/MM/DD HH:MM:SS", which PHP does parse correctly.

It's the middle slash which is probably the issue, in other words.


PHP can parse that string: strptime($time, '%Y/%m/%d/%H:%M:%S')

0

精彩评论

暂无评论...
验证码 换一张
取 消