function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raj 6Raj 6 

how to convert milliseconds to hours in apex

Amritesh SahuAmritesh Sahu
Hi Rajkumar,

Just divide the millisecond value with 3600000.

Long milliseconds = 5000000;
Double hours = milliseconds/3600000;

Now, the value of hours will be 1.38

Bob DeRosierBob DeRosier
it is basic units conversion;   1000 ms/sec  * 60 sec/min * 60 min/hr  =3600000 ms/hour