PC Review


Reply
Thread Tools Rate Thread

Time Formatting

 
 
stan
Guest
Posts: n/a
 
      2nd Aug 2003
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
 
Reply With Quote
 
 
 
 
stan
Guest
Posts: n/a
 
      2nd Aug 2003
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
>:-)
>"stan" <(E-Mail Removed)> wrote:
>
>>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

>
>.
>

 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      2nd Aug 2003
"stan" <(E-Mail Removed)> wrote in
news:062501c35899$df93ecc0$(E-Mail Removed):

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time formatting S. A. Stone Microsoft Excel Discussion 0 25th Oct 2009 01:48 AM
Formatting decimal numbers as time - no conversion to time =?Utf-8?B?S2VuIFNwcmluZ2Vy?= Microsoft Excel Discussion 3 14th Sep 2006 06:08 AM
Time formatting =?Utf-8?B?V29sZm1hbg==?= Microsoft Access 1 22nd Dec 2004 01:58 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Microsoft Excel Worksheet Functions 4 18th Nov 2004 04:24 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Microsoft Excel Worksheet Functions 0 18th Nov 2004 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:55 PM.