Change format of time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

I want to show it in the format of mm:ss how can I do this?
 
Try this ---
Time Worked: Int((DateDiff("s", BeginTime, EndTime))/60) &":"&
(DateDiff("s", BeginTime, EndTime)) Mod 60
 
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)
 
Oops. That assumed minutes, not seconds. Should be

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top