Permalink
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 657 Bytes
title version signature
As ISO 8601 String
2.1.0
moment().toISOString();

Formats a string to the ISO8601 standard.

moment().toISOString() // 2013-02-04T22:44:30.652Z

Note that .toISOString() always returns a timestamp in UTC, even if the moment in question is in local mode. This is done to provide consistency with the specification for native JavaScript Date .toISOString(), as outlined in the ES2015 specification.

From version 2.8.4 the native Date.prototype.toISOString is used if available, for performance reasons.