Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert time to seconds

Status
Not open for further replies.

deesheeha

Programmer
Jul 28, 2006
38
IE
Hi, i have a date variable which captures the time when a button is pressed. does anyone know how i can covert this to seconds?? as when its stored in a table its stored as an integer
 
hmm, that didnt work. let me show you my code

dim CallLength As Date
MsgBox CallLength, vnOKOnly <--- returned 00.33.30
CallLength = CInt(CallLength)
MsgBox CallLength, vbOKOnly < --- returned 00.00.00
 
You want just the Time portion of a DateTime field converted to seconds?
Code:
nSeconds = Int(86400 * TimeValue([DateField]))
 



Hi,

FYI. TIME is part of Date/Time as is in UNITS of DAYS.

Simple third grade arithmetic to convert from DAYS to SECONDS.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top