what is the php command for convert this this date and time format 2016-09-15T16:00:00Z format to timestamp (example: 1490313600) ?
Asked
Active
Viewed 1,178 times
-1
-
2Use `strtotime()` – Mohammad Nov 06 '16 at 10:51
-
http://stackoverflow.com/questions/2891937/strtotime-doesnt-work-with-dd-mm-yyyy-format – prasanth Nov 06 '16 at 10:53
-
1Possible duplicate of [How to convert date to timestamp in PHP?](http://stackoverflow.com/questions/113829/how-to-convert-date-to-timestamp-in-php) – Syed Waqas Bukhary Nov 06 '16 at 20:50
1 Answers
0
Its a strtotime()
<?php
echo strtotime("2016-09-15T16:00:00Z");
?>
ouput
1473955200

prasanth
- 22,145
- 4
- 29
- 53
-
isnt possible to do conversion with this type of code ? [strtotime(2016-09-15T16:00:00Z)] – Jack Liew Nov 06 '16 at 11:09
-
No its possible to convert.i was added code see my answer.and i was also check with my localhost.Its working – prasanth Nov 06 '16 at 11:17
-
error occured from the output Warning: date() expects parameter 2 to be long, string given in xxxxxx – Jack Liew Nov 06 '16 at 11:20
-
@JackLiew Can you tell what you are expecting?In this part code working fine for me – prasanth Nov 06 '16 at 11:31