Convert to ISO time format in Angular using moment.js
'Z' is a token witch will show time zone. You can add your 'Z' as part of string
https://momentjs.com/docs/#/displaying/format/
console.log(moment().format('YYYYMMDDTHHmmss') + 'Z');

The second option is Escaping characters using []
console.log(moment().format('YYYYMMDDTHHmmss[Z]'));


I'm trying to format date in this below format

20230201T103000Z

i tried this method in angular
moment(utctime).format('YYYYMMDDTHHmmsssZ')

this is returning following date format
20230523T1900000+05:30

