FIX: Setting the sharepoint regional settings and saving date values
Jan 9, 2009

Generally we are saving the date values by “DateTime.Now.ToString()” for the SharePoint list item fields. This works fine if our regional setting’s locale for the site is “English (United State)”. But if we change the locale to “English (United Kingdom)” and try to save the date by using the above method then it will throw the exception. To fix this just use “yyyy-MM-ddTHH:mm:ssZ” as the parameter to the “.ToString()” method for the datetime. So for example use DateTime.Now.ToString(“yyyy-MM-ddTHH:mm:ssZ”). This will save the value without any exception.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Related Posts

Designer workflow failed on start when item is added

I recently got stuck with one of the strange trouble with a developer….

Jun 16, 2010

“There is not enough space on the disk” error while exporting SharePoint site

Today while trying to export a large sub-site using Export-SPWeb command through powershell, we got…

May 16, 2012

Retrieving text from RichTextField control of SharePoint

If you are new to using SharePoint’s RichTextField control, then you are most…

May 30, 2012
Top

Copyright © Prakash Software Solutions Pvt. Ltd. All Rights Reserved.