var date = \"2012-01-18T16:03\"; var date = new Date(date); console.log(date.getMinutes()); console.log(date.getMinutes().length)
This returns 3.
you should check if it is less than 10... not looking for the length of it , because this is a number and not a string