0

I'm using php and trying to determine what the following date/time format is so I can write PHP code to this date/time format

2019-12-17T17:23:49.782Z

daily-learner
  • 617
  • 1
  • 8
  • 17
  • https://en.wikipedia.org/wiki/ISO_8601 in UTC format – aynber Dec 17 '19 at 17:41
  • 1
    look [here](https://stackoverflow.com/questions/8405087/what-is-this-date-format-2011-08-12t201746-384z) for the format explanation. For your PHP code it depends what you need as a result. From the format you just need to know that this is UTC timezone – Anatoliy R Dec 17 '19 at 17:43
  • You can use 'Ymd\THis\Z' as the format. something like gmdate('Ymd\THis\Z', time()) – bodi87 Dec 17 '19 at 18:01

1 Answers1

-1

This is iso 8061, so you can try like this:

$date = '2019-12-17T17:23:49.782Z';
$date = date('Y-m-d', strtotime(substr($date,0,10)));
echo $date;
dennisgon
  • 337
  • 3
  • 14