DateTime format String and get current sharepoint region setting

//CultureInfo enAU = new CultureInfo(“en-AU”);

//IssueDate.ToString(“d”, enAU);

DateTime.ToString(“d”); //date only => 4/09/2013

 

reference :

http://msdn.microsoft.com/en-us/library/az4se3k1.aspx

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

 

//setting DateTimeControl LocaleId as current sharepoint region setting(‘DD/MM/YYYY’ LocaleId=”2057″)

int currentLocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleId);

DC_IssueDate.LocaleId = currentLocaleId;

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: