Change format of time

P

pokdbz

I have this statement
DateDiff("s", BeginTime, EndTime)

I want to show it in the format of mm:ss how can I do this?
 
K

KARL DEWEY

Try this ---
Time Worked: Int((DateDiff("s", BeginTime, EndTime))/60) &":"&
(DateDiff("s", BeginTime, EndTime)) Mod 60
 
D

Douglas J. Steele

Another possibility is

Time Worked: Format(DateDiff("s", BeginTime, EndTime)/1440.0, "hh:nn")

(This, of course, will fail if it's more than 24 hours)
 
D

Douglas J. Steele

Oops. That assumed minutes, not seconds. Should be

Time Worked: Format(DateDiff("s", BeginTime, EndTime)/86400.0, "hh:nn")
 
Top