LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get Right Real time when calculate from back to, 01-01-1900 00: 00: 00.

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.

 

0 Kudos
Message 11 of 21
(1,719 Views)
For further information this all comes as a consequence of this post.
0 Kudos
Message 12 of 21
(1,717 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 13 of 21
(1,712 Views)

Here's a nugget from my utilities directory.

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 21
(1,707 Views)

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.

0 Kudos
Message 15 of 21
(1,702 Views)

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 

0 Kudos
Message 16 of 21
(1,690 Views)

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?


"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 21
(1,686 Views)

HI to All

Here I got a link that tells what Excel does.

Excel

 

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.

HFZ
0 Kudos
Message 18 of 21
(1,655 Views)

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.

 

 

 

HFZ
Download All
0 Kudos
Message 19 of 21
(1,646 Views)
hi.. all i just want is data from 1-1-1970 00:00:00 till current date time to b converted into seconds..how it is possible?..is the previous example in tis attachment is correct?
0 Kudos
Message 20 of 21
(1,470 Views)