08-02-2026 05:48 PM - edited 08-02-2026 05:53 PM
Hi,
I am trying to find a format specifier combination for time stamps which will be written to file. In using the file I need to see the date and when processing the data I need all the decimal digits of the time stamp. I have made a small vi incorporating the timestamp source from my main program to play around with but cannot get the correct format specifier. Using this format specifier "%H%M%S%8u" on the Format Date/time String VI it is outputting the correct number of decimal places but the other part is not recognisable as the date minutes seconds. ie 140404.51230382.
I put that format Date/Time String vi in my test vi just to test a different way of doing it but what I really want to do is carry on with the Format into string vi. But editing the Format into String vi format specifier didnt seem to work.
Any suggestions gratefully received
Solved! Go to Solution.
08-02-2026 10:05 PM
@EdHarris wrote: Using this format specifier "%H%M%S%8u" on the Format Date/time String VI it is outputting the correct number of decimal places but the other part is not recognisable as the date minutes seconds. ie 140404.51230382.
What do you mean by “not recognisable”?
According to your specifier, the “14” represents the hours (in UTC), “04” the minutes, and the next “04” the seconds; the rest is the fractional part.
What result are you expecting?
08-03-2026 12:57 AM - edited 08-03-2026 12:58 AM
Do you simply want separators? Use "%H.%M.%S%8u" or "%H:%M:%S%8u".
08-03-2026 03:27 AM - edited 08-03-2026 03:29 AM
@Andrey_Dmitriev wrote:
@EdHarris wrote: Using this format specifier "%H%M%S%8u" on the Format Date/time String VI it is outputting the correct number of decimal places but the other part is not recognisable as the date minutes seconds. ie 140404.51230382.What do you mean by “not recognisable”?
According to your specifier, the “14” represents the hours (in UTC), “04” the minutes, and the next “04” the seconds; the rest is the fractional part.
What result are you expecting?
You are right, it is the correct time for my location. My next problem is how to add the date?
Looks like I will only be able to do this by using multiple Format Date/Time String vis because if I try adding any more % specifiers in the Format into string VI it says too many format specifiers. Is there away round that?
08-03-2026 03:36 AM - edited 08-03-2026 03:40 AM
@EdHarris wrote:
You are right, it is the correct time for my location. My next problem is how to add the date?
Exactly the same way:
Refer to the help topic: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/format-date-time-string.html
Or something like this if you prefer:
The "%,;" can specify separator for the fractional part - "." or ",".
08-03-2026 07:03 AM
With my exposure to Python, I have grown fond of ISO 8601 datetime strings.
Epoch Date & Time Toolkit for LabVIEW - Download - VIPM by JKI library provides a VI to format ISO8601 strings
08-03-2026 08:11 AM
Thats really helpful.
I also found %c%8u produces this format: 03/08/2026 13:55:18.44514274
But I had to rewrite my code like this because couldnt make the Format into String VI do anything useful.
08-03-2026 08:21 AM - edited 08-03-2026 08:22 AM
Hi Ed,
@EdHarris wrote:
But I had to rewrite my code like this because couldnt make the Format into String VI do anything useful.
Why shouldn't FormatIntoString doesn't format timestamps correctly? Did you read the help for the format codes?

When using %c format code you need to keep in mind the result can differ between computers/account settings…
08-03-2026 08:35 AM
@GerdW wrote:
Hi Ed,
@EdHarris wrote:
But I had to rewrite my code like this because couldnt make the Format into String VI do anything useful.
Why shouldn't FormatIntoString doesn't format timestamps correctly? Did you read the help for the format codes?
When using %c format code you need to keep in mind the result can differ between computers/account settings…
If you have multiple inputs, I couldnt find any way of making them be treated separately. Format into stringVI just thinks every % in the box applies to a separate input and threw an error for too many percent codes. You see there are multiple % codes in each format specifier for each input.
08-03-2026 08:45 AM - edited 08-03-2026 08:52 AM
Hi Ed,
@EdHarris wrote:
If you have multiple inputs, I couldnt find any way of making them be treated separately. Format into stringVI just thinks every % in the box applies to a separate input and threw an error for too many percent codes.
You see there are multiple % codes in each format specifier for each input.
There are already two %-codes for each value in the last example.
Next example:

3 input values for FormatIntoString, formatted 3 times as timestamp, with different (number of) formatting codes per entry…
@EdHarris wrote:
Format into stringVI just thinks every % in the box applies to a separate input
Yes, sure. But if you read the help for those formatting codes you should have noticed the "Variable Order" format code %$ that allows using the same input several times…
Did you read the help?
3rd example:

2 input values formatted as 3 items…