Time Formatting

S

stan

I have a time field which is diplayed in hours, seconds
and minutes (07:32:19). What is the easiest way to
convert this to just seconds (27,139). I would like to
create a function in VBA so I can reuse it.

Thanks
 
S

stan

Thank you!

-----Original Message-----
Hello Stan
'Call e.g. toSeconds(CVDate("07:32:19"))
Public function toSeconds(byval dtTime) as double
toseconds=Hour(dtTime)*3600+Minute(dtTime)*60+Second (dtTime)
End Function
Do a Errorcheck plz
Heiko
:)


.
 
T

Tim Ferguson

I have a time field which is diplayed in hours, seconds
and minutes (07:32:19). What is the easiest way to
convert this to just seconds (27,139).

dwSeconds = TimeValue(dtSomeTime) * 24 * 60 * 60

HTH


Tim F
 

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

Top