HUGO

Have the date displayed in french

Hello,

If you go on this crab theme demo page here :
https://themes.gohugo.io//theme/crab/contact/

In the content part, under the title, you can see the date written in English : March 18, 2019

If I would like to use this crab theme, how can you make Hugo write the date in French like :
8 mars 2019

In essence how do you customize the date format to have it writen in my local french language ?

Thanks for th help.

Andrew

It does not work very well.

The best I could get was with those parameters as dateformat

        languageCode = "fr-fr"
        dateFormat = "2 Jan 2006"
        dateFormatFull = "02/01/2006"
        dateFormatTime = "2 Jan 2006 15:04"

I don’t remember exactly the details of my tests but I couldn’t succeed having localized dates in multi-language site (this point is clearly stated in the documentation)

Par exemple ainsi: Dates : only in english?

Je viens de faire un commit sur un site que je suis en train de développer (ce qui m’a permis de factoriser certaines choses). Voir ici:

1 Like

Ahhh cool. Insta volé ! Thanks.

1 Like

You could also use a data file, as exemplified in the documentation: Customize Dates.

1 Like

Hello,

Just wanted to say thank you !

With all your replies, I was able to find a solution and display my dates in French.

It’s cool.

1 Like