Reputation: 1181
What is the most efficient way to convert a given European formatted date (DD/MM/YY) to the correct timestamp?
Example: 10/11/12 should output 1352505600 as the 10th November 2012, and not the October 11th 2012
Upvotes: 1
Views: 2688
Reputation: 219814
$date = DateTime::createFromFormat('d/m/y', $eu_date);
echo $date->format("U");
Upvotes: 3
Reputation: 1017
Use the 2nd optional variable to the date function to feed it the unix timestamp
Upvotes: 0