moment js convert date to iso 8601 code example Example: how to get iso date with moment moment().toISOString(); // or format() - see below