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

Retrieving text from RichTextField control of SharePoint

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

May 30, 2012

How to add master page with styles and images in site definition

There is often a requirement to add customized master page (with images and…

May 16, 2009

Changing the language of an existing SharePoint site

Recently, I had a problem with an existing SharePoint site. The problem was…

Dec 26, 2008

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