cancel
Showing results for 
Search instead for 
Did you mean: 

How to format time stamp?

aspanda
New Contributor II

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

1 REPLY 1

aleung
Contributor III

Here is your solution:

Date.now().toString().substr(0,22)+“Z”