Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.vb.general.discussion > #118472
| From | ObiWan <obiwan@mvps.org.invalid> |
|---|---|
| Newsgroups | microsoft.public.vb.general.discussion |
| Subject | Re: Which is better |
| Date | 2024-06-03 14:35 +0200 |
| Organization | n/a |
| Message-ID | <v3kdb2$15aer$1@solani.org> (permalink) |
| References | <v3a472$vi2i$1@solani.org> <v3fucm$134er$1@solani.org> <v3jrle$15632$1@solani.org> <v3jrrm$15632$2@solani.org> |
:: On Mon, 3 Jun 2024 09:37:25 +0200
:: (microsoft.public.vb.general.discussion)
:: <v3jrrm$15632$2@solani.org>
:: ObiWan <obiwan@mvps.org.invalid> wrote:
>
> > Use the "datediff" to obtain a difference in seconds
> >
> > https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/datediff-function
>
> air code
>
> dtStr = Now()
>
> do some stuff...
>
> dtEnd = Now()
>
> dDiff = datediff("s", dtStr, dtEnd)
Or either (air code)
Function ElapsedTime(ByVal dt As Date, Optional ByVal bStr As Boolean = False) As Double
Static dtStr As Date
If bStr Then
dtStr = Now()
ElapsedTime = dtStr
Exit Function
End If
ElapsedTime = DateDiff("s", dtStr, Now())
End Function
the way it works should hopefully be clear :)
Back to microsoft.public.vb.general.discussion | Previous | Next — Previous in thread | Next in thread | Find similar
Which is better StanWeiss <srweiss1@comcast.net> - 2024-05-30 10:58 -0400
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-05-30 17:33 +0200
Re: Which is better StanWeiss <srweiss1@comcast.net> - 2024-05-31 09:07 -0400
Re: Which is better StanWeiss <srweiss1@comcast.net> - 2024-06-01 15:56 -0400
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 09:34 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 09:37 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 14:35 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 14:59 +0200
Re: Which is better StanWeiss <srweiss1@comcast.net> - 2024-06-03 10:24 -0400
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 17:25 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-03 17:39 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-04 18:16 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-05 16:00 +0200
Re: Which is better ObiWan <obiwan@mvps.org.invalid> - 2024-06-05 16:39 +0200
csiph-web