Date format

  • Thread starter Thread starter Tony WONG
  • Start date Start date
T

Tony WONG

Both server (iis6) and my workstation (VS2008) set short date format
2009/12/22 at control panel (region)

But the aspx page at server shows 22/12/2009

The aspx page at my workstation shows 2009/12/22

How to make them same? Thanks.

Tony
 
Both server (iis6) and my workstation (VS2008) set short date format
2009/12/22 at control panel (region)

But the aspx page at server shows 22/12/2009

The aspx page at my workstation shows 2009/12/22

How to make them same?  Thanks.

Tony

The datetime format depends on current culture of the application.

In the web.config file add

<system.web>
<globalization culture="en-CA" uiCulture="en-CA" />
</system.web>

This assumes that your current culture will format the date as dd/MM/
yyyy (Canada)

See more: http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.80).aspx
 
Thanks Alexey

But i have questions
same aspx,
same web.config (before and after adding Globalization...)
same short date format (control panel)
at my VS2008 workstation and Windows 2003 server IIS6
but different date formats

Thank you.


"Alexey Smirnov" <[email protected]>
???????:[email protected]...
Both server (iis6) and my workstation (VS2008) set short date format
2009/12/22 at control panel (region)

But the aspx page at server shows 22/12/2009

The aspx page at my workstation shows 2009/12/22

How to make them same? Thanks.

Tony

The datetime format depends on current culture of the application.

In the web.config file add

<system.web>
<globalization culture="en-CA" uiCulture="en-CA" />
</system.web>

This assumes that your current culture will format the date as dd/MM/
yyyy (Canada)

See more:
http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.80).aspx
 
Back
Top