Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert string to a date

Status
Not open for further replies.

TMac42

Programmer
Jul 24, 2000
83
US
My querystring is passing in:

Fri Sep 16 00:00:00 GMT-0500 2005

Is there a fuction that will take this string and convert it to simply give me mm/dd/yyyy?? Otherwise, I'm thinking I'll have to use mid, right, etc. to parse the string.

Thoughts?
 
To use CDate, it must have a date as input. I used IsDate() to check my string value and it is not recognized as a true date. So, I may be stuck with parsing the string... unless anyone else has any ideas. Thanks.
 
You might also look at FormatDateTime() function and DateValue() function.

------------------------------------------------------------------------------------------------------------------------
"I am not young enough to know everything."
Oscar Wilde (1854-1900)
 
Pretty sure all the date functions like that require actual dates (except the one that asks for parts, which means parsing).
 
If you split that string on spaces then it should be easy to pick up the parts you need to create a date or reformat one.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top