LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time format

For a status report of the program, showing each command sended and the actions executed,  I want to introduce a time stamp at the beginning of each line
0 Kudos
Message 1 of 7
(3,080 Views)
I'm not sure about what exactely you're asking for...

If it's just about how to to get a date and time string then it's very easy... see attached picture.





We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 7
(3,077 Views)
I don´t know why, there are 2 messages created, one of them only with half text. Sorry about that. Here is the full one:
 
"For a status report showing each command sended and execution of the program, I want to add a time stamp in the beginning of each line of it. To obtain a more clear result, I want all characters in the same space, but I can´t achieve it due to the hour field, as shown in this example:
 
8:57:43 command example1
10:01:07 command example2 
 
I have seen how to remove the leading zeros (with #) from minutes and seconds, but not how to add it to the hour, which is what I´m looking for.
 
I know that there is another option: split the string, analyze the hour and add a initial space if is under 10, but it looks a quite dirty solution. So I guess it can be implemented with the time format string. Somebody knows how?
 
Thanks."
 
Gatet
0 Kudos
Message 3 of 7
(3,072 Views)
Well then sory, I can't answer the full question... I'd use the string functions to fix it... Maybe there's a better way.

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 7
(3,069 Views)

Thanks anyway, Titou.

By the way, I get the solutionSmiley Very Happy

 

0 Kudos
Message 5 of 7
(3,062 Views)

I see that this is an ancient thread but I'm having the same issue and the proposed solution does not work for me. I'm using a very similar format string (%H:%M:%S%2u) and it does not give me a leading zero for single-digit hours. Does anyone have a solution?

0 Kudos
Message 6 of 7
(2,543 Views)
0 Kudos
Message 7 of 7
(2,531 Views)