PHP : Better date parser than strtotime
php
Solution
Unfortunately, it seems that such parsing is better done manually, by exploding the string at slashes and then switching day and month.
Problem
I'm trying to parse a string in a specific format and I'm really surprised to discover that I can't find a good function to do that. The only one I found is strtotime and it doesn't fit as it guesses the date format. I really don't trust the "guess" part. Moreover my string input is in a french format (dd/mm/aaaa) which it seems that it's not well understood (it parses american formats like mm/dd/aaaa). What I'm looking for is a function that take in input a date string and a format to parse. I could do it myself with a regexp but I can't believe that it doesn't already exist. I found : - DateTime::createFromFormat(). But it only work with PHP 5.3 and I don't have the power to upgrade the PHP version (5.2) - strptime(). This method does what I want but is not implemented on windows platform (by the way: WTF ??) Any suggestion ?