该内容不适用于您选择的语言

该内容将以另一种语言显示出来。 您可使用浏览器的翻译功能查看内容。

Display Current Time in LabVIEW VI

Updated Oct 18, 2023

Reported In

Software

  • LabVIEW

Issue Details

  • I would like to display the current time in my LabVIEW VI.
  • How do I create a software-timed millisecond timestamp in LabVIEW?

Solution

You can display the current time using a timestamp in LabVIEW. This can be written in your application using the Get Date/Time In Seconds VI as shown below:

 Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram. 
 
Furthermore, you can format the Date/Time as a string so that you can easily transfer that timestamp into other programs (text or .csv files).
You can format the timestamp to include date and time information based on your application's needs (like complete date, milliseconds, etc.). Use the Format Date/Time String VI to determine the syntax of your timestamp data.
  • The default timestamp format is %m/%d/%Y%H:%M:%S. 
  • For example, if you wanted to include the milliseconds, you would append a %3u to the end of the string: %m/%d/%Y%H:%M:%S%3u.
 
 Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.