Date format

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
T

Tim Marsden

Hi,

I have a component which retrieves to short date format from the culture of
the current thread.
When the component is called from a windows form environment it returns
"en-GB", "dd/mm/yy", all OK.
When I call the same component from a web form it return "en-GB", "M/d/yy".
These are different.
I am running on the same machine, and I have checked the regional settings,
which are set to "dd/mm/yy".

Can anybody tell me why the date formats are different for application
running on my IIS. Is there a setting I have overlooked.

Regards
Tim
 
Tim,

Tim Marsden said:
I have a component which retrieves to short date format from the culture
of the current thread.
When the component is called from a windows form environment it returns
"en-GB", "dd/mm/yy", all OK.
When I call the same component from a web form it return "en-GB",
"M/d/yy". These are different.
I am running on the same machine, and I have checked the regional
settings, which are set to "dd/mm/yy".

Can anybody tell me why the date formats are different for application
running on my IIS. Is there a setting I have overlooked.

You can change the culture in your "web.config" file (element
'globalization', attributes 'culture' and 'uiCulture').
 
Yes,
It is my development machine, this occurs during testing and debug.
 
Hi

I agree with Herfried's suggestion.
You may try to specified the culture in the web.config.
Because the asp.net 's thread is managed in a thread pool, and in the means
time there will be many websites or virtual directory running, so we can
specifed the culture in the web.config.

<globalization requestEncoding="any valid encoding string"
responseEncoding="any valid encoding string"
fileEncoding="any valid encoding string"
culture="any valid culture string"
uiCulture="any valid culture string"/>

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Similar Threads


Back
Top