ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   serial time (https://www.excelbanter.com/excel-programming/370682-serial-time.html)

David Gerstman

serial time
 
Using subtraction I see that one second in serial time equals
1.15740740740389E-05. I'm supposed to calculate the difference between two
times. Is it OK to use this number as a basis for calculating the times and
the differences between them?

This way milliseconds will play a role even though I don't really need to
display them. (I need to be able to show that 4:17:26.9 is earlier than
4:17:27.0 even though they'll both display as 4:12:27.)

Is this an OK shortcut to take when dealing with times? Are there any side
effects that I need to know about?



Tom Ogilvy

serial time
 
just do a comparison if that is your end result

if Range("C1").Value < Range("D1").Value then

if you need to divide by seconds, use

timeserial(0,0,1)

anyway, I get: 0.0000115740740740741

which seems correct for a repeating decimal.

--
Regards,
Tom Ogilvy




"David Gerstman" wrote:

Using subtraction I see that one second in serial time equals
1.15740740740389E-05. I'm supposed to calculate the difference between two
times. Is it OK to use this number as a basis for calculating the times and
the differences between them?

This way milliseconds will play a role even though I don't really need to
display them. (I need to be able to show that 4:17:26.9 is earlier than
4:17:27.0 even though they'll both display as 4:12:27.)

Is this an OK shortcut to take when dealing with times? Are there any side
effects that I need to know about?



Tom Ogilvy

serial time
 
forgot to add:
from the immediate window:

? 1#/(24#*60#*60#)
1.15740740740741E-05

--
Regards,
Tom Ogilvy


"David Gerstman" wrote:

Using subtraction I see that one second in serial time equals
1.15740740740389E-05. I'm supposed to calculate the difference between two
times. Is it OK to use this number as a basis for calculating the times and
the differences between them?

This way milliseconds will play a role even though I don't really need to
display them. (I need to be able to show that 4:17:26.9 is earlier than
4:17:27.0 even though they'll both display as 4:12:27.)

Is this an OK shortcut to take when dealing with times? Are there any side
effects that I need to know about?




All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com