Sep 25, 2009

How to get the Date Time from the regional settings of the page

To get the Date Time related information from the site’s Regional settings ,here is the sample code snippet.

SPSite site = new SPSite("http://spvm:1234/");

SPWeb web = site.OpenWeb();

DateTime dt = web.RegionalSettings.TimeZone.LocalTimeToUTC((DateTime.Now));

This way we can get the current time zone settings like which time zone we are using and date and time

So your job is done

Enjoy !!!

No comments:

Post a Comment