LabVIEW uses epoch January 1, 1904 to generate timestamps. The steps below demonstrate how to account for this to ensure that epoch January 1, 1970 is used. Alternatively, scroll to the bottom to save the completed code from a LabVIEW snippet.
1. Verify that the target's date and time settings are correct.
- Open NI Measurement & Automation Explorer (MAX).
- Expand the Remote Systems branch and select your remote target.
- From the bottom of the window, select the Time Settings tab.
- Ensure that the Time Zone is set to (UTC) Coordinated Universal Time, and that Automatically adjust clock for Daylight Saving Time is unchecked.
- To verify that the current time is correct, refer to [External] Current Millis.
- Click Save to save changes.
- Restart the target.

2. Open LabVIEW and create a new VI.
3. On the Block Diagram:
- Place a Subtract function from the Numeric palette.
- On the x input of Subtract, place a Timestamp Constant and set it's value to 00:00:00:000 01/01/1970.
- On the y input of Subtract, place a Timestamp Constant and set it's value to 00:00:00.000 DD/MM/YYYY.
- This corresponds to the earliest date and time that LabVIEW uses, which is midnight on January 1, 1904.
- Place another Subtract function.
- Connect the output of the first Subtract to the y input of the new Subtract.
- On the x input of the new Subtract, place a Get Date/Time in Seconds function.
- Place a To Double Precision Float function on the output of the Subtract.
- [Optional] If milliseconds are required in the Unix timestamp:
- Place a Multiply function.
- Connect the output of the To Double Precision Float function to one of the Multiply inputs.
- Connect a Double Numeric Constant to the other input and set it's value to 1000.
- Connect a To Signed 64-bit Integer function. The output of this is the Unix timestamp.
- [Optional] If the timestamp should be a String data type:
- Place a Number to Decimal String function.
- Connect to output of To Signed 64-bit Integer to the Number input.
- Create a String Indicator on the Decimal Integer String output.
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.