LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion from Excel time to labview time

Hello all,

                                   I want to convert the excel time stamp to labview time stamp. Can you all please help me how to do this ?

 

In my application labview time is 05-11-12 14:56:00 and its equivalent excel time representation is 41218.6222222222.

 

I tried this formula,

Labview time =  24*3600*(Excel time - 1460) but anwer is wrong.

 

Thanks.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 21
(3,556 Views)

Did you search first?

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 2 of 21
(3,533 Views)

Ok, here's what I found.  The conversion is:  Time Stamp = 86400*(Excel Time - 1462).  But here's the kicker: the timestamp is GMT.  You have to add your time zone offset as well.  I'm in the Eastern Time Zone, so I had to add 5 hours.  I'm not sure what DST will do to this.  I'm sure there's ways around it, I just don't have time to look into it more right now.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 21
(3,532 Views)

Hi crossrulz,

                                     This logic is not working, Please try the number what i provided in the question.

 

Thanks.

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 21
(3,508 Views)

Hi all,

                            What i found is that when representing the time into excel sheet. the difference between time is not constant

 

 

#1. 14:51:00 11-05-2012    ------   41218.61875

 

#2. 14:52:00 11-05-2012    ------   41218.6194444444

 

#3. 14:53:00 11-05-2012    ------   41218.6201388889

 

#4. 14:54:00 11-05-2012    ------   41218.6208333333

 

#5. 14:55:00 11-05-2012    ------   41218.6215277778

 

#6. 14:56:00 11-05-2012    ------   41218.6222222222

 

 

So if the difference between the numbers is not same than we cannot find any common logic for conversion.

Agree friends ?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 21
(3,504 Views)

There are some slight rounding issues, but the results are fine for me...

 

NOTE: My date is setup as M/D/Y


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 21
(3,492 Views)

Its look like that i am committing some mistake. I also tried this but my answer is wrong. Can you please tell me why ?

 

One more thing how exactly you got this 1462, i think this should be 1460 ?

 

Thanks,

 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 21
(3,474 Views)

@Ranjeet_Singh wrote:

Its look like that i am committing some mistake. I also tried this but my answer is wrong. Can you please tell me why ?

 

One more thing how exactly you got this 1462, i think this should be 1460 ?


What time zone are you in? Can you attach the actual VI?

 

I put "1/1/1904 0:0:0" into and cell in Excel and then performed a value() on that cell.  The result was 1462.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 21
(3,457 Views)

@Ranjeet_Singh wrote:

Its look like that i am committing some mistake. I also tried this but my answer is wrong. Can you please tell me why ?

 

One more thing how exactly you got this 1462, i think this should be 1460 ?

 

Thanks,

 

 



Excel has two errors related to its data calculations.

 

1.  Day 0 is Jan 0, 1900.  Which of course doesn't exist.  Jan 1, 1900 is day 1 in Excel. (There is a 1 day error.)

2.  Excel thinks that Feb. 29, 1900 exists as a leap day, while in reality it doesn't.  (So there is another 1 day error.)

 

Day 0 is Jan 1, 1904 GMT in LabVIEW .  And since it doesn't have the year 1900, the presence of a leap day in 1900 or the lack thereof doesn't show up in LabVIEW's data calculations.

0 Kudos
Message 9 of 21
(3,447 Views)

another one.

Time to XL can be downloaded from here https://decibel.ni.com/content/docs/DOC-19689

as well as it's inverse XL to Time

 

Significantly Excel epoch is dependant on the OS system time zone (Yes, it is insane 0 means midnight on the 0th of January 1900 local time) and there is the famous leapyear bug Microsoft copied fron Lotus)

Don't forget to vote


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 21
(3,440 Views)