Time Formatting

  • Thread starter Thread starter stan
  • Start date Start date
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
 
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
:-)


.
 
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
 
Back
Top