Echoing dates on french site?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 19, 2013   (RSS)

By mizrahi - September 19, 2013

I have a multilingual site (english and french) and I need to display the dates in preferred format on the french site. Any guidance on how I can do this? 

By Jason - September 19, 2013

Hi,

Yes, you can output dates in any format needed using the PHP date() function.  In this function, you set the format that you want dates to display in.

For example, if you had a field called "date" and wanted to output it in a dd/mm/YYYY format, you can do so like this:

<?php echo date("d/m/Y", strtotime($record['date']));?>

For more information about the different date formats you can use, take a look at the date manual page on php.net:

http://ca3.php.net/manual/en/function.date.php

Hope this helps

---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By mizrahi - September 19, 2013

Currently the months dates are written out (January, February, etc.) and I think the client prefers it that way. Is there a way to output the french translations of the months instead?