- MomentJS Tutorial
- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
- MomentJS Useful Resources
- MomentJS - Quick Guide
- MomentJS - Useful Resources
- MomentJS - Discussion
MomentJS - As ISO 8601 String
This method formats a string to the ISO8601 standard. It gives the timestamp in UTC form.
Syntax
moment().toISOString(); moment().toISOString(keepOffset);
Example
var a = moment().toISOString();
Output
To avoid the display in UTC form use true in toISOString(true) as shown
Example
var a = moment().toISOString(true);
Output
momentjs_formatting_date_and_time.htm
Advertisements