Qazi Qazi - 1 year ago 42
PHP Question

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

I want to show the datetime in the following format

2015-01-05T06:27:50.000Z


How I can achieve this ?

Answer Source

Try this:

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