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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a String to a Date

Status
Not open for further replies.

troyarch

MIS
Mar 12, 2003
29
US
I would like to convert the string in a String data type into a Date data type. The string would look like this: 11/28/05 11:11 AM

I will have some data checking to make sure the string is always formatted like this.

I have looked online to find a solution but have found nothing. Any help on how to do this convertion would be appreciated.
 
like this:

Code:
var d = new Date("11/28/2005 11:11 AM");

you must not have searched too hard. p.s. - using "05" as the year yields 1905.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top