Format datetime...

  • Thread starter Thread starter Doug Swanson
  • Start date Start date
D

Doug Swanson

I'm trying to get a datetime value (10/24/2001 6:00 AM) to display as
10/24/01 6:00. I know I could hard code some format but I'm trying to use
the culture info etc. so that (and this is my understanding of it) if in the
web.config I change the culture info to some country that disaplays as
dd/mm/yy hh:mm then my app will display this in that manner.
I can't seem to find any examples using the culture info...on a side note if
I have a varable (mydate as DateTime) and it has a valid datetime value and
I use one of it's functions...aka mydate.getshortdate() or
mydate.getlongdate() will this return the value according to what my culture
info is set to.

thanks
Doug

--
Doug Swanson
Senior Applications Developer
Synchrono, Inc
651.228.1772
(e-mail address removed)
 
I had to display all my dates in Australian format.
The solution turned out to be really easy.
I just added a culture attribute to the end of my globalization tag in my
web.config:

<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="en-AU"/>
 
Back
Top