-3

I would like to create a string indicating current date, in such a format: Javascript or Typescript:

2017-01-09T15:00:00Z

I would like to generate it based on current time. What would be the easiest approach. The other way is simple.

Jerzy Gruszka
  • 1,629
  • 4
  • 15
  • 20
  • 3
    Possible duplicate of [Where can I find documentation on formatting a date in JavaScript?](http://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript) – JJJ Aug 29 '16 at 14:51
  • and of http://stackoverflow.com/questions/1531093/how-to-get-current-date-in-javascript too ? – Simo Aug 29 '16 at 14:52

1 Answers1

0

Moment.js is good for many different styles of date formatting. http://momentjs.com/

moment().format('MMMM Do YYYY, h:mm:ss a') // August 30th 2016, 11:44:55 am
Caleb Macdonald Black
  • 1,494
  • 12
  • 17