Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1279
  • Last Modified:

How do I convert dd-mmm-yyyy (14-Sep-2004) into javascript date format?

How do I convert dd-mmm-yyyy (14-Sep-2004) into javascript date format?

I'd also like to be able to deal with the following kind of date string 1-Sep-2004 (where we unfortunately encounter d-mmm-yyyy rather than the desired dd-mmm-yyyy.
0
GessWurker
Asked:
GessWurker
  • 2
1 Solution
 
cwolvesCommented:
new Date('14-sep-2004'.replace('-', ' '));

in other words, use spaces instead of dashes
0
 
GessWurkerAuthor Commented:
Perfect! Thanks!
0
 
cwolvesCommented:
yep :-)  and ty
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now