PHP date format /Date(1365004652303-0500)/

后端 未结 10 1131
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 05:56

I am calling an API from where I am getting date /Date(1365004652303-0500)/, I don\'t understand what format this is. How is this date format called? I was not

10条回答
  •  失恋的感觉
    2020-11-27 06:34

    You can use this package to parse the JSON dates:

    https://github.com/webapix/dot-net-json-date-formatter

    use \Webapix\DotNetJsonDate\Date;
    
    $dateTime = Date::toDateTime('/Date(1365004652303-0500)/'); 
    // return with \DateTime object, you can format it: $dateTime->format('Y-m-d H:i:s')
    

提交回复
热议问题