Home > other >  date format - Regional settings - Months in lowercase
date format - Regional settings - Months in lowercase

Time:12-07

I'm a noob (I confess it) and can't manage to find a solution to my problem. I'm setting up the date format on Drupal and it uses the PHP date format. Right now it's "d F Y", so it appears as 07 Dicembre 2021 (in Italian), but in Italian months are written out in lowercase. Is there a way to transform Dicembre into dicembre? I couldn't find a proper way. Thanks for your help!

CodePudding user response:

You should use the locale aware strftime, which formats according to the current locale.


setlocale(LC_TIME, "it_IT");
echo strftime("%d %B %Y"); // 07 dicembre 2021

CodePudding user response:

Using strtolower() the output will be as you expected:

<?php echo strtolower(date("M"),2);?>

So to implement it only for Month, simply break the date format into 3 parts. Day , Month, Year.

  • Related