Easy time/maths question

1. Member
Join Date
Dec 1969
Posts
39

Easy time/maths question

I have a string that has, for example, a value of 420. If I&#039;m taking this to mean 435 minutes, what is the math to change the string to 7 hours 15 minutes.

2. Senior Member
Join Date
Dec 1969
Posts
11,334

Check out the Mod() function

and see what it does for ya :)

3. Member
Join Date
Dec 1969
Posts
39

RE: Check out the Mod() function

Had a look at the MOD() Function but still a bit stumped as to how to take it further.<BR><BR>Where minVar = 420<BR><BR>timeVar = minVar MOD 60<BR><BR>timeVar = 0<BR><BR>Any help appreciated...<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
11,247

Something like

Function MinutesToString(Minutes)<BR>MinutesToString = ((Minutes Mod 60) 60) & ":" & (Minutes Mod 60) <BR>end Function<BR><BR>to call use MinutesToString(TimeSpent) <BR><BR>Untested

5. Member
Join Date
Dec 1969
Posts
81

RE: Something like

Use:<BR>Int(Minutes / 60) & ":" & (Minutes Mod 60)

6. Senior Member
Join Date
Dec 1969
Posts
11,247

RE: Something like

Int(Minutes 60) & ":" & (Minutes Mod 60) <BR>Want int divide

Posting Permissions

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