Getting the current date and time by corresponding Timezone- Typescript

Solution:

var dateFormat = ‘YYYY-DD-MM HH:mm:ss’;

currentDate=new Date();
var testDateUtc = moment.utc(this.currentDate);
var localDate = testDateUtc.local();
console.log(localDate.format(dateFormat));

Add Comment