Is there a php func that does this:
$timestamp = get_timestamp_from_str('d/m/Y H:i', '10/10/2012 10:10');
strtotime() will use the USA version for ’10/10/2012′ wich is m/d/Y, but i have the day first.
For a particular case i can make my own parser, but the date format can change depending on the visitors local settings. However, i will always know the current format.
I had to insert this last paragraph so that this question is long and good enough for this portals question quality filter
Thank you
Yes, it’s called
DateTime::createFromFormat().You would use it as:
Just make sure your timezone string is in the list of supported timezones.