1

I'm trying to sign an Amazon request and I need the following timestamp format:

gmdate('Y-m-d\TH:i:s\Z');

How can I obtain that in a nodejs environment? Many thanks in advance.

Jumpa
  • 4,059
  • 11
  • 44
  • 95
  • [MomentJS](https://momentjs.com/) is one of the most popular JS libraries for date-time manipulation. – 31piy Dec 14 '17 at 09:26
  • 1
    You should provide an example of the format you require, there is little consistency for tokens used in date and time format strings. – RobG Dec 14 '17 at 12:32
  • Probably a duplicate of [*Where can I find documentation on formatting a date in JavaScript?*](https://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript) – RobG Dec 14 '17 at 19:51

1 Answers1

10

For anyone who will need this:

new Date().toISOString()

That's it. Merry Xmas to the downvoters!

Jumpa
  • 4,059
  • 11
  • 44
  • 95