LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to read date and time from an excel spreadsheet?

I am trying to aquite the date and time string from an excel file.

 

I have already read this:

http://digital.ni.com/public.nsf/allkb/01B026BEB54E3414862571B600618827

 

Which allowed me to get the date string. But it does not read the time.

 

How can i get the date and time string?

 

 

0 Kudos
Message 1 of 2
(2,200 Views)

Excel stores date/time as a Serial Date, representing everything in units of "Days".  If you use the integer part of the Excel value, you can get the Date, as it is "number of days since 1 Jan 1904" (with some slop for time zones and other peculiarities).  The "fraction of a day" is the time (again, may need to fudge time zones) -- if you take the fractional part and multiply it by 86400 (# seconds in a day), you'll get time in seconds, and can split off Hours and Minutes by dividing twice by 60 (60 seconds/minute, 60 minutes/hour).

Message 2 of 2
(2,171 Views)