Link to home
Start Free TrialLog in
Avatar of UPRRDevelopers
UPRRDevelopers

asked on

How to Convert MON DD HH:MM:SS YYYY Format in VB?

I have a date/time value I'm reading from a database that returns the date/time in this format:
May 01 16:17:32 2009    ... I would like to convert this to a better format, such as this:
05/01 16:17:32

I don't see an easy way to do that in VB ... can someone help?  Thanks.
ASKER CERTIFIED SOLUTION
Avatar of FER_G
FER_G
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnBPrice
JohnBPrice

If the date is indeed stored as a date in the database, you can do
dim MyDate as string
MyDate = Format(rs.fields("DBDateField"), "mm/dd Hh:Nn:Ss")
Avatar of UPRRDevelopers

ASKER

Perfect... thanks for the quick answer!