SSbits - Home page
Site by Carbon Crayon
Submit a Post >

Snippets - Little bits of code to make you happy

Using Dates in Foreign Languages

With all the translatable, i18n and other translation related stuff in silverstripe, I think more than one is wondering how to achieve something simple as using dates in a foreign language... Actually, it's ultra easy if you add this 2 lines in your silverstripe powered website.

Here is my Spanish example:


setlocale(LC_ALL, 'es_ES');   
Then in your template
$Date.FormatI18N(%A %e de %B de %Y)





This will render

miércoles 21 de octubre de 2009

Aram Balakjian avatar

Aram Balakjian

Aram is a web developer running London based agency Aab Web. He has a strong passion for developing attractive, usable sites around the SilverStripe CMS.

  • Nobrainer Web
    13/02/2013 10:39am (4 years ago)

    Hi Aram, i just needed some info regarding dates matching the current language, and i came across this post.

    I was actually looking for the system to display a different date format depending on the current language of the site.

    I found the following post very helpfull and thought i would share it here:


Post a comment ...

You cannot post comments until you have logged in. Login Here.


Site of the Month

Find SSbits on

Top Contributers

Rank Avatar Name
1 article image Aram Balakjian
2 article image wfacewomens
3 article image Daniel Hensby
4 article image Marcus Dalgren
5 article image ryduhartchas
6 article image Hamish Campbell
7 article image Ty Barho
8 article image Martijn van Nieuwenhoven
9 article image Darren-Lee
10 article image Roman Schmid

View full leaderboard