So I discovered the wonders of DateTime and DateTimeZone but must have overlooked one critical problem - I cannot see how to use the current locale to format a timestamp! For example, today I would like to say its "Mars" (french), not "March". How can I do that with these classes?
Use fr_FR as the locale paremeter, when formating the date, or you could also do: <?php $date = date("F", time()); //don't have to use preg_replace - could be done using str_replace (simpler) but i prefer using preg_replace. $date = preg_replace('~January~', 'Janvier', $date); $date = preg_replace('~March~', 'Mars', $date); //and continue the months... echo $date; ?> PHP: