PHP: how to display the date in the following format (2015-01-05T06: 27: 50.000Z)?

I want to show datetime in the following format

2015-01-05T06:27:50.000Z 

How can i achieve this?

+4
source share
2 answers

Try the following:

<?php echo date("Y-m-d\TH:i:s.000\Z", strtotime("2015-01-05 06:27:50")); ?> 
+5
source

If you want to include the correct timecode:

date('Y-m-d\TH:i:s\.Z\Z');
0
source

Source: https://habr.com/ru/post/1570113/


All Articles