LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read custom excel time data in LabView

 I have an Excel spreadsheet where the cells that contain the time data I need are formatted as custom h:mm:ss. When I try to read this cell as numeric I get 0.78588. If I read it as text I get 0.728587962963. I know the difference between those two is due to the indicator properties.

 How does that number relate to 17:29:10? How do I format/read it correctly? Everything I've read concerning time stamps in excel doesn't seem to fit this situation. Do I need to format the cells in excel by hand to get it to read in LabView?

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 1 of 4
(3,211 Views)

Remember that the numeric dates and times in Excel are based on days.  So 1 day equals 1.  A half day is 12 noon equals 0.5.  6 pm would be 0.75.  Your example is just below 0.75 which makes sense because your decimal is around 0.72.

 

LabVIEW's time is based on seconds.  There are 86,400 seconds in a day.  (24 hrs x 60 min x 60 sec)  So you just need to multiply the number you get out of Excel by 86400 and feed that into the "To Time Stamp" function.

 

If you are working with dates, you have to know that the base date for Excel is different from the base date for LabVIEW  (0 is something like 12/31/1903 7pm (or 1/1/1904 midnightGMT because the time zone factors in as well).    I believe Microsoft is based on 1/1/1900 midnight.  Search the forums for more conversation on this and how to convert dates.

Message 2 of 4
(3,201 Views)

Ravens Fan,

 Sorry for the late responce. Your reply really cleared this up for me "numeric dates and times in Excel are based on days.". I read tons of replys and white papers but didn't really put togather that the time would be less then 1 and that is what confused me.

Again thanks for clearing this up. Smiley Very Happy

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 3 of 4
(3,170 Views)
You're welcome. I am glad it's cleared up.Smiley Happy
Message 4 of 4
(3,158 Views)