Parse Date in PHP

#1
I need some help parsing a date in PHP to a date object. I thought this was 8601 format, but $date = DateTime::createFromFormat(DateTime::ISO8601, "2018-11-14T01:11:36.059Z") is not working.

Date Format is: 2018-11-14T01:11:36.059Z
 

Admin

Administrator
Thành viên BQT
#2
Try This:
Mã:
echo date('Y-m-d H:i:s', strtotime('2018-11-14T01:11:36.059Z'));

//Output
2018-11-13 20:11:36
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top