DEV Community

Dhanush
Dhanush

Posted on

Answer: Convert UTC timestamp to PST in Angular

You can add time manually using getTime(). which gets time in milliseconds.

  1. 1 minute = 60000 milliseconds
  2. 60 minutes = 60x60000
  3. 5 hours = 300x60000
  4. and so on...

Eg:

curDate=new Date();

futDate=new Date(this.curDate.getTime()+330*60000);

This will add 5 hours 30 minutes to current time.

Top comments (1)

Collapse
 
dhanush9952 profile image
Dhanush

Time conversion in TypeScript..