Posts

Showing posts from January, 2017

Fixed "String was not recognized as a valid DateTime" error in SharePoint 2013 when date is valid

I met the issue "String was not recognised as a valid DateTime" when I executed the code which using " DateTime.Parse(strdate)" to convert the string value with date format "01/03/2016" (Australian date format) in a SharePoint 2013 site.  The code is executed successfully in another SharePoint environment, and so I verify the "Regional settings" in this SharePoint site, and found out the "Time zone" settings is correct which set to "Sydney" time zone and the "Locale" settings was set to "English (United States)" which is incorrect, and so I change the "Locale" settings to "English (Australia)". I refresh the WebPart Page again, and the issue was gone!