LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Date/Time Operations

Hello
 
 
What is the simple way to perform Date (and Time) operations like Additional, Substractions etc....in LabWindows/CVI.
 
Thanks and Regards
Rakesh
 
 
0 Kudos
Message 1 of 2
(3,165 Views)

In my opinion the best way to perform date/time calculation is to rely on SDK functions.

SystemTimeToVariantTime transforms a SYSTEMTIME structure into a variant time, i.e. a decimal number whose integer portion is related to date and whose fractional portion relates to time. VariantTimeToSystemTime performs the opposite operation, returning the value in a SYSTEMTIME whose elements are day/month/...

Once in variant time, you can add, subtract, etc time and date with the corresponding algebric operations. It's basically what excel does with Date/Time format.

To use these functions you will need to include in your project windows.h and oleauto.h, and to add oleaut32.lib.
 
You find an exhaustive description of time functions inside the SDK help: look in the TOC for Management services >> Windows System Informations >> Time.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,156 Views)