Home > DVWP, SharePoint > Date formatting in DVWPs – Quick Tip

Date formatting in DVWPs – Quick Tip

I’ve been working a lot lately on the DVWP in SharePoint Designer and have found that when you add in a date field, it will render in mm/dd/yyyy by default.  Now this is fine if you are in America but for us over here in the UK, we prefer the dd/mm/yyyy format.

To make the change, we need to highlight the date field in our DVWP and go into the Code view.  There you will see the default format code of 1033 (as shown below) – you simply need to change 1033 to 2057 and save

<xsl:value-of select=”ddwrt:FormatDate(string(@Created) , 1033 ,1)” />

For a list of all the codes available, click here

PS. Thanks to @sympmarc and @jbhoward for all their help in my DVWP journey thus far 🙂

 

Categories: DVWP, SharePoint
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment