I have string:
"Lundi, 08 Juillet 2013 09:09"
How can I parse this type string?
I try:
$date = '08 Juillet 2013 09:09';
$date = new \DateTime($date);
But it throw exception
The intl
extension can be used for this:
// create formatter
$fmt = new IntlDateFormatter(
"fr-FR",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Etc/UTC',
IntlDateFormatter::GREGORIAN,
'EEEE, dd MMMM y hh:mm'
);
// parse
$ts = $fmt->parse('Lundi, 08 Juillet 2013 09:09');
echo $ts; // 1373274540
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With