I have this function where user can update current time this.oldTime
this is old date and time, 10:06
this is new time it can be 04:25
. I want to find the difference how many minutes added or subtracted from old time.
UpdateTime()
{
this.utcTime = new Date().toUTCString();
this.oldTime = new Date(this.utcTime).toLocaleString('en-US', { timeZone: 'Asia/Calcutta' });
let oldTime=this.datepipe.transform(this.oldTime, "yyyy-MM-dd HH:mm:ss")); // 2023-04-15 08:42:12
let userenteredTime=this.newTime; // 10:06
}
}