Regional settings made at the operating system level

K

Karunakararao

Hi All

regional settings made at the operating system level. For example, Canada
uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. and yyyy/mm/dd

how can i get this type date format :
iam using this code in C#:
System.DateTime.UtcNow.Date.ToString();

Regards
Venu.
 
M

Morten Wennevik

Hi Karunakararao,

You can output a DateTime in any format you desire.
Take a look at the overloaded methods of DateTime.ToString
You can use a custom string format or an IFormatProvider, for instance a CultureInfo.DateTimeFormat (current culture?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top