2

In my XSL file, I set my date like this:

<xsl:value-of select="ddwrt:FormatDate(@Date, 2057, 3)" />

This gives me an English date like 07 April 2015. Can I get this date in French?

4

Just replace 2057 with 1036 (the LCID of fr-FR) and it should render the date in a French format.

The possible values for the third parameter, which control what type of date string is rendered, are listed in the MSDN blog post “Custom Date Formats in SharePoint XSL”.

| improve this answer | |
  • Do you have a documentation on this? If i change it to 1036 i have the day prepended to the date (i don't want it). – Mike Boutin Jul 14 '15 at 15:17
  • I've updated with a link to a good blog post. In short you will have to play with the third parameter to find the rendering that you want. Also if the rendering you want is not available with French local maybe som of the other examples in that link can get you what you want – Robert Lindgren Jul 14 '15 at 15:26
  • Thank you for your answer! But... What a bad function... I can't format the date like a wanted to... There's only these values... 1- 4/7/2015 12:00 AM || 2- 07/04/2015 || 4- mardi 7 avril 2015 || 5- 00:00 || 6- 07/04/2015 00:00 || 8- mardi 7 avril 2015 00:00 || 13- 00:00:00 || 14- 07/04/2015 00:00:00 || 16- mardi 7 avril 2015 00:00:00 – Mike Boutin Jul 14 '15 at 15:37
  • Try ddwrt:FormatDateTime function... you'll be able to put in your custom format string. msdn.microsoft.com/en-us/library/… – JayHell Jul 14 '15 at 15:38
  • Yeah it is a bit limited, as @jayhell says there are better functions if you know exactly how you want it formatted – Robert Lindgren Jul 14 '15 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.