05-20-2009 10:41 AM
Well, Excel wrongly thinks that 1900 is a leap year
try entering 59, 60 and 61 into three Excel cells, then set the formatting to date, and you get
28/02/1900, 29/02/1900, 01/03/1900
Thinking back to the original problem of getting a LV time stamp converted into a format that Excel will understand, why not do a format date/time string on the time stamp, and put the resulting string into Excel?
The default format on my system says that a few minutes ago it was "20/05/2009 16:32:42"
With a format string of "%c%1u" you get say "20/05/2009 16:34:25.1"
Rod.
05-20-2009 10:48 AM
05-20-2009 11:01 AM
Rod wrote:Well, Excel wrongly thinks that 1900 is a leap year
try entering 59, 60 and 61 into three Excel cells, then set the formatting to date, and you get
28/02/1900, 29/02/1900, 01/03/1900
There's a good reason for it. See this good story for details.
05-20-2009 11:08 AM
Here's a nugget from my utilities directory.
05-20-2009 11:15 AM
Ravens Fan wrote:
So the difference between 1/1/1900 and 1/1/1904 is 4*365 +1 or 1461 days or 126,230,400 seconds.
CORRECTION:
The difference between the two is actually 1462 days. That is because day 0 for Excel is Jan 0, 1900 (whatever that is supposed to mean?). Day 1 is Jan 1, 1900. Day 60 is Feb 29, 1900 (which doesn't really exist). Day 1462 in Excel is Jan 1, 1904.
So the difference is 1462 days or 126,316,800 seconds.
05-20-2009 11:45 AM
Thanks for the enlightening discussion.
Are leap seconds tracked anywhere? I cannot think of any reason to need them, but for the sake of comprehensive coverage of timekeeping I ask.
Lynn
05-20-2009 11:54 AM
Yes leap seconds are tracked, just not in any PC. To get leap seconds you need to talk to the keeper of CIVIL time the US Naval Observatoy (also the Vice Pres's official residence btw). NIST maintains several daytime servers that can provide you with the current time of day. to calculate the exact number of SI second that have elapsed from a given epoch you just need to add 86400 * the number of days elapsed, correct for time-zone, correct for DST and correct for number of leap seconds(LS's can be + or -). Days, Zone and DST are tracked in the OS (with the noted exception of 29 Feb 1900) so you only need to add in the LS lookup from a list.
Why though?
05-25-2009 02:18 AM
HI to All
Here I got a link that tells what Excel does.
The right and in same time the wrong thing to do is to calculate back 4 years and add it to the Labview Seconds counts since 1904.! But Remember that excel counts year 1900 as a Leap year although it's NOT! That is a mistake that microsoft choose to live with.
HFZ.
05-25-2009 04:08 AM
I've used these two attached VI's to give the timestamp and calculate to EXCEL Format so the right time stamp can be viewed correct in excel. But there are still something that is not right.!
I Still get a wrong time format when Excel views the timestamp.!
There are still wrong calculations for the period from 01-01-1900 00:00:00:000 - 01-01-1904 00:00:00:000.
This compensation is necessary as mentioned earlier .
HFZ.
12-30-2009 02:06 AM