12-01-2025 04:57 AM - edited 12-01-2025 05:56 AM
Hi all,
I have a VI where I’m using the “Get Date/Time In Seconds” function wired to a “Get Date/Time String” function. LabVIEW suggests that I could replace these two functions with a single “Get Date/Time String” to simplify the code.
I’m not entirely sure if I’m missing something, or if replacing it could affect other parts of my VI.
I’ve attached two images for reference:
The part of my block diagram where these functions are used.
The VI Analyzer output showing the suggestion.
Could someone confirm whether it’s safe to just use “Get Date/Time String” alone, and if there are any caveats I should be aware of?
Thanks in advance!
Solved! Go to Solution.
12-01-2025 05:33 AM
Hi Hilter,
@HIlter wrote:
I’ve attached two images for reference:
No, you did not…
@HIlter wrote:
Could someone confirm whether it’s safe to just use “Get Date/Time String” alone, and if there are any caveats I should be aware of?
Read the help for that function to learn about its default input value.
That's all you need to know…
12-01-2025 06:12 AM - edited 12-01-2025 06:50 AM
@HIlter wrote:
Could someone confirm whether it’s safe to just use “Get Date/Time String” alone, and if there are any caveats I should be aware of?
Using "Get Date/Time String" with an unwired timestamp has one caveat, because of this bug still present in LV2025 Q3:
https://forums.ni.com/t5/LabVIEW/Get-Date-Time-String-unexpected-rounding/td-p/4392916
If you require a timestamp string that is accurate to the second, I would recommend to either keep your code as it is (wiring the output of "Get Date/Time In Seconds" to the input of "Get Date/Time String"), or use "Format Date/Time String" instead, as shown in the linked thread.
Regards,
Raphaël.
12-01-2025 12:43 PM
@HIlter wrote:
I’m not entirely sure if I’m missing something, or if replacing it could affect other parts of my VI.
You already got excellent advice, so I won't repeat all that. If you deal with dates/times as strings, we can assume that further use is more cosmetic than anything and I doubt you later want to do millisecond math with it.
If you "follow the wire" what kind of downstream code depends on these strings. Also, where in relation to all other running code, do you get these strings and how often?
Can you attach the full VI?
Just a curiosity:
It is interesting that the icon shows January 1989 which places it somewhere between LabVIEW 1 and 2, but it is also possible that this was an attempt a "future-proofing" from the beginning. :D.
12-02-2025 09:36 AM - edited 12-02-2025 09:38 AM
@HIlter wrote:
You really should change your username it's too close to another name.
12-02-2025 10:07 AM
@mcduff wrote:
@HIlter wrote:You really should change your username it's too close to another name.
It is also a seemingly nice community in Germany as well as a family name originating in Scotland. 🙂