I have a date string what I would like to convert in digits. The string looks like
Dienstag, 30. Oktober 2012
and the code what I've been trying to use
date('Y.m.d' , strtotime($str[4]));
returns every time 1970.01.01
You can make this by changing the current locale set http://php.net/manual/bg/function.setlocale.php If you know the source date format you can also stick to using https://www.php.net/date_create_from_format
Here is more details regarding the same question strtotime With Different Languages?
<?php
setlocale(LC_ALL, 'fr_FR');
$str= 'Dienstag, 30. Oktober 2012';
echo date('Y.m.d' , strtotime($str[4]));
?>