var date = \"2012-01-18T16:03\"; var date = new Date(date); console.log(date.getMinutes()); console.log(date.getMinutes().length)
This returns 3.
If you're using AngularJS in your project, just inject $filter and use it like here:
$filter('date')(value, 'HH:mm')
You can also format the output in the template, more on filters here.