How to format time stamp?

Date.now().toString() - it provides the result - 2014-09-22T00:00:00.000Z(like this)
but i need time stamp like - 2014-09-22T00:00:00.00Z. I want only two digits before Z.

Thank you for the help in advance

Here is your solution:

Date.now().toString().substr(0,22)+ā€œZā€

1 Like