- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2017 04:04 AM
How can I concert time from second to hours ?
Example :- If seconds = 2403
then hours = 2400/3600 = .6675
thanks,
Sourabh
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2017 05:37 AM
Like this?
In Background scripts:
d = Number(2403);
var h = (d / 3600).toFixed(4);
gs.print(h);
I get:
[0:00:00.000] Script completed in scope global: script
*** Script: 0.6675
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2017 04:07 AM
d = Number(d);
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2017 05:19 AM
Hi Sergiu,
In above solution h,m,s provide duration in hours,minute and second separately. While I need duration in hours in decimal format.
Like
if seconds = 2403
then hours = 2400/3600 = .6675
Thanks,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2017 05:37 AM
Like this?
In Background scripts:
d = Number(2403);
var h = (d / 3600).toFixed(4);
gs.print(h);
I get:
[0:00:00.000] Script completed in scope global: script
*** Script: 0.6675