• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

formatting hours into days hours minutes (no seconds!!!)

I have a datediff that returns 1,367.2 hours.  I want to easily convert that to days, hours and minutes.  Can you help me out please?
1 Solution
There is no easy way. you need to code it.

Can you use Vb.NET?
Try a formula like this

Local NumberVar numDays;
Local NumberVar numHours;
Local NumberVar numMinutes;
Local NumberVar TimeDiff;

TimeDiff := DateDiff('h',{StartTime},{EndTime});  //THis is your datediff formula

numMinutes := TimeDIff * 60;
numDays := numMinutes \ (24 * 60);
numMinutes := numMinutes MOD (24 * 60);
numHours := numMinutes \ 60;
numMinutes := numMInutes MOD 60;

CStr(numDays,0) & ' days ' & CStr(numHours,0) & ' hours ' & CStr(numMinutes,0) & ' minutes.'

Open in new window

ddschreck01Author Commented:
Well, that's what I was doing but I was hoping there was some clever way to do it.  Thanks for validating my thining...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now