Any ideas for translating PHP weekdays and months to local language? I have script which prints weekdays of next 5 weeks and I want that they are in other language.
$timestamp = strtotime('next Monday');
for ($i = 0; $i < 35; $i++) {
echo strftime('%A', $timestamp)." ";
$timestamp = strtotime('+1 day', $timestamp);
}
Is there any good integrations e.g. with PHP and moment.js? I have looked at Use PHP's date() formats in moment.js and GitHub fightbulc/moment.php , but I don't understand how to use those..
Thank you in advance.
You are probably looking for the following:
http://php.net/manual/en/function.setlocale.php
http://php.net/manual/en/function.strftime.php
UPDATE
setlocale(LC_TIME, "fi");
echo utf8_encode(strftime('%A'));
RESULT
perjantaina
And this as a gift for you guys - the ISO language codes
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