Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am simply trying to get the following to return the date in the English(Australian) format by using in my Page_load:

 

<code>

Session.LCID = 3081;

</code>

 

 

I then do :

 

<code>

DateTime TodaysDate = System.DateTime.Now;

</code>

 

expecting to receive my date as dd/MM/yyyy but I keep getting mm/dd/yyyy, IE the american format.

 

I checked my globalisation settings on my machine and they are English(Australia) but I presume this shouldn't matter since I used the Session.LCID = 3081;.

 

Anyone help me?

  • *Gurus*
Posted
Set the current culture using the [msdn]System.Threading.Thread[/msdn].CurrentThread.CurrentCulture and [msdn]System.Threading.Thread[/msdn].CurrentThread.CurrentUICulture properties. Setting Session.LCID (which maps to [msdn]System.Globalization.CultureInfo[/msdn].LCID) has little affect on formatting of dates and times.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...