

Since PDT = GMT – 7, we’re going to subtract 7/24 for a fraction of a day Convert seconds to days and adjust for timezone.Find the “When calculating this workbook” section and select “Use 1904 date system” Convert the entire Excel spreadsheet to the 1904 date system.At this moment, you’re probably telling yourself “Oh I know, I need to covert this to days since 1904 because I read this really informative article!” Well, you would be right and you could also do crazy things like write macros or pre-convert the numbers in LabVIEW but why bother when you can use native functions? If you enter this number into Excel and change the cell format as a Date, you end up with “#”. Going back to the original example (now with sub seconds added), converting 4:03:48.724 PM to a double results in 3514835028.724. In the many years of developing in LabVIEW, I’ve always wondered what’s up with the 1904 date system as it always seemed arbitrary to me and then discovering that there’s many other date systems including the 1900 date system! After some Internet sleuthing, I ran into this article on that discusses the two date systems, an entertaining blog entry article by Joel Spolsky (of course he had something to say on this), and discovered the term epoch used as a reference date in computing. On the other hand, Excel uses the 1900 date system and a “serial number” which is the number of days since January 1, 1904. You see, LabVIEW uses the 1904 date system and the double precision number is the number of seconds since January 1, 1904. But it’s only great until somebody wants to display the absolute time in Excel. Storing a number this way is great since you can easily convert it back in LabVIEW. To convert it back, use the “To Time Stamp” function. With LabVIEW, can you do this by simply using the “To Double Precision” function. However, with a string time stamp of say, 4:03:48 PM, that’s 20 characters.Ī more efficient approach would be to convert the time stamp into a double (8 bytes). The first approach would be to use “Format Date/Time String” function. But what if I just wanted to store a simple time stamp? Along with the functions on the Timing palette, there’s a number of functions in File I/O palette including TDMS and Datalog. Your temperatures are 22.180 and 22.080 (not sure what unit probably degrees Celsius).LabVIEW time stamps can be stored in a number of ways.

The calculation shown is to convert a hex value to a decimal value and scale it into an actual temperature (divide by 1000). (character 32) = Line Feed (also part of a new line character) (character 31) = Carriage Return (part of a new line character) (characters 2-7) T1 Value = 0x0056A4 = 22180 There are four built-in string to number conversion functions in LabVIEW that convert string input data to its associated numeric output data types : Decimal String to Number - converts string input to an integer format. If I am reading the directions correctly, you can break this reading up into sections:
