View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] thesquirrel@gmail.com[_2_] is offline
external usenet poster
 
Posts: 39
Default Variables with times between Midnight and 1:30am

I have an interesting problem, I am writing a function where there are
a few hard coded times for the function to use. I am however having
problems applying a variable value to 1:00 AM. Here is my code for the
variable application

ThirdStart = #1:00:00 AM#

However when I would expect to see the variable (defined as a double)
contain "0.041666666666", the variable contains "4.16666666666667E-02".
If I set the hard coded value to:

ThirdStart = #1:30:00 AM#

The variable contains the expected result of "0.0625".

I have also checked my hardcoded midnight value:

Midnight = #12:00:00 AM#

which also contains the expected value of "0".

This only happens on times between #12:00:01 AM# and #1:29:59 AM#.

Anyone have an answer to this problem? I am programming in Excel 2003
for reference.

Thanks in advance!