Time Function

1. Junior Member
Join Date
Dec 1969
Posts
14

## Time Function

Hi Guys, I can&#039;t seem to wrap my head around this one, maybe its too early in the morning :-)<BR><BR>What I&#039;m trying to do is write a function that will calculate the<BR><BR>Days : Hours : Minutes from an Input of total Minutes based on a 7.5 hour day.<BR><BR>This is what I have so far...<BR><BR>Function displayTime(intMins)<BR> &#039;450 Minutes / day<BR> &#039;60 minutes / hours<BR> &#039;1 minutes / minute<BR>Dim intDays<BR>Dim intHours<BR> intDays = intMins/450<BR> intHours = (intMins Mod 450)/60)<BR> intMins = intMins - (intDays*450) - (intHours *60)<BR> intMins = intHours Mod 7.5<BR>displayTime = int(intDays) & ":" & int(intHours) & ":" & int(intMins)<BR>End Function<BR><BR>Any help would be greatly appreciated! :-)<BR>

2. Junior Member
Join Date
Dec 1969
Posts
14

## Got it

In case anyones Interested......<BR><BR>Function displayTime(intMins)<BR> &#039;450 Minutes / day<BR> &#039;60 minutes / hours<BR> &#039;1 minutes / minute<BR>Dim intDays, intHours, intMinutes<BR>intMinutes = int((intMins Mod 450) Mod 60)<BR>if len(intMinutes) = 1 then intMinutes = "0" & intMinutes<BR>intHours = int(((intMins Mod 450)/60))<BR>if len(intHours) = 1 then intHours = "0" & intHours<BR>intDays = int(intMins/450)<BR>displayTime = intDays & ":" & intHours & ":" & intMinutes<BR>End Function<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•