Converting a Date/Time String into a Timestamp Constant in LabVIEW

Updated Jan 11, 2018

Reported In

Software

  • LabVIEW Professional

Issue Details

I have a Date/Time string in LabVIEW and I want to convert it into a LabVIEW Timestamp datatype. How do I do this?

Solution

To convert the Date/Time string into a Time Stamp constant you have two primary options:

Use the Scan from String VI:
  1. Place a Scan from String VI on the block diagram.
  2. Right-click the Scan from String VI and select Edit Scan String from the dropdown menu.
  3. Select Scan time stamp from the Selected operation menu.
  4. Customize the string format using the Corresponding scan string textbox. You can use the Time Stamp Format Codes to correct format the string. Note: If you leave the format string as %T, LabVIEW will guess based on commonly used formats. An example of using this method is shown below:
Use the NumText.Text property of a Time Stamp control or indicator:
  1. Create a Time Stamp control or indicator.
  2. Create a Property Node for the control or indicator and select the NumText.Text property.
  3. Right-click the Property Node and select Change All to Write.
  4. Right-click the Time Stamp control or indicator and select Properties.
  5. Navigate to the Display Format tab to customize the string format interactively as shown below.

 
Here is an example of using this method:
 
 

    WAS THIS ARTICLE HELPFUL?

    Not Helpful