LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the actual time out of windows?

Hallo, (using LabWindow/CVI 6.0)

I would like to read the actual time out of Windows to create a Logfile with Timestamp (hh:mm:ss)

Is this possible?
If it is , with which function can I realize this?

thx a lot
Florian
0 Kudos
Message 1 of 3
(3,054 Views)
The easiest way is to use the following:

time_t tm;
struct tm *xtm;
char msg[64];

t = time (NULL);
tm = localtime (&t);
strcpy (msg, asctime (tm));
DebugPrintf ("%s", msg);

It produces this output:
Wed Apr 20 14:50:10 2005

In case you want a different format for the output string, you must use strftime () which permits you to define your own format.


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 3
(3,045 Views)
it works and the function strftime() do his job, too.

thank you very much
Florian
0 Kudos
Message 3 of 3
(3,039 Views)