I'm trying to generate links to Google calendar and see this tool:
https://decomaan.github.io/google-calendar-link-generator/
And the links are generated as:
and as you can see the dates are like:
20210105T103300Z
and I am trying to convert this to my own dates but I don't know which type is this and how to format. I have the dates both, in moment or in date, but don't know how to convert.
Since you're using moment.js: moment().utc().format('YYYYMMDDTHHmmss[Z]')
, or without a library new Date().toISOString().replace(/\W/g,'').replace(/\d{3}Z/,'Z')
. This is really a duplicate of How to format a JavaScript date.
Source: comment by RobG Jan 11 at 12:58