2

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,319
  • 11
  • 52
  • 100
  • [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

12

For anyone who will need this:

new Date().toISOString()
E_net4
  • 27,810
  • 13
  • 101
  • 139
Jumpa
  • 4,319
  • 11
  • 52
  • 100