Qazi Qazi - 4 months ago 10
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

Try this:

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