Skip to content
Advertisement

date_parse_from_format to unix timestamp

I have a question regarding the date_parse_from_format() method:

JavaScript

Returns associative array with detailed info about given date.

This will return an array with some date info. But is there any way to convert it to a unix timestamp?

Advertisement

Answer

Johan,

Heres an exact example of how to implement mktime into your scenario:

JavaScript

For future reference, you can use var_dump() or print_r() on an array to see how to access the nested values.

var_dump of $parsed

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement