Reputation: 41433
Hay, how can i turn a string like "04 Jan 2010" into a string like "1/4/2010". Can i do this with the JS date object?
Thanks
Upvotes: 1
Views: 260
Reputation: 109
You can try this: timeSolver.js
var dateString = timeSolver.getString("04 Jan 2010", "MM/DD/YYYY");
You can get date string by using this method:
getString(date, format)
Hope this will help you!
Upvotes: 0
Reputation: 139
The JavaScript function getYear()
is deprecated. You should use getFullYear()
instead.
Upvotes: 0
Reputation: 6362
Perhaps Date.parse() is what you're looking for?
If that doesn't do it, then Datejs adds more robust parsing.
Upvotes: 3