I have date in without "/" in text field and it is in mm/dd/yy
format. We received input in this format 03292014. I want to get month,date and year from this number like 03/29/2014
var m = new Date(3292014*1000)
console.log(m.toGMTString())
I have date in without "/" in text field and it is in mm/dd/yy
format. We received input in this format 03292014. I want to get month,date and year from this number like 03/29/2014
var m = new Date(3292014*1000)
console.log(m.toGMTString())
Get the components from the input, then you can create a
Date
object from them. Example:You could do this :
Or convert the input into a standard "YYYY-MM-DD" format :
Specs : http://es5.github.io/#x15.9.1.15.
According to Xotic750's comment, in case you just want to change the format :