Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Format datetime...

Reply
Thread Tools

Format datetime...

 
 
Doug Swanson
Guest
Posts: n/a
 
      10-17-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      10-17-2003
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"/>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com



"Doug Swanson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Money Format + Decimal Place Format shannon Java 1 02-02-2006 03:47 PM
Money Format + Decimal Place Format shannon Java 0 02-01-2006 10:02 PM
need code to convert float format to internal java float format which is kept in 4 bytes integer Andy Java 7 05-10-2004 09:26 PM
NTFS quick format and normal format Guan Foo Wah MCSE 2 05-08-2004 11:35 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM



Advertisments