In terms of best practices, what is the recommended approach to localize date and time outputs in PHP for multilingual websites?

When creating a multilingual website in PHP, it's important to localize date and time outputs to cater to users from different regions. The recommended approach is to use the setlocale function to set the desired locale for date and time formatting. This function allows you to specify the language and region settings for displaying dates and times in the desired format.

// Set the desired locale for date and time formatting
setlocale(LC_TIME, 'fr_FR.UTF-8');

// Output the current date and time in the specified locale
echo strftime('%A %d %B %Y %H:%M:%S');