I am showing the custom date in my Web Part but it showing one Day added to date. The current date field is DateTime Format, so I am showing only date it work but it showing one day added to date.

This is my Code :

< xsl:value-of select="ddwrt:FormatDateTime(@ActivityDate, 1033, 'MM/dd/yyyy')" />

It showing one day added date.

  • are you checked the regional language setting at your site setting, check the time zone and the selected calendar Oct 14 '16 at 10:45
  • Yes i checked and also select the calendar.
    – John D
    Oct 14 '16 at 10:49

Try to check Site Settings : Regional Settings , make sure that you are selected the correct time zone also check calendar type, where there's some calendar like Hijri calendar can add one day or subtract one day.

If everything is okay, try to do the following :

<xsl:variable name="date" select="ddwrt:FormatDateTimeUsingCurrentContext(string(@ActivityDate))"/>
<xsl:value-of select="ddwrt:FormatDateTime($date, 1033, 'MM/dd/yyyy')" />

where FormatDateTimeUsingCurrentContext format @ActivityDate based on your current SharePoint context settings .


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.