DEV Community

Dhanush
Dhanush

Posted on

5 1 1

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..

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay