Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 rating:
 1 out of 5     Rate this Document

Get Date/Time in Seconds Function in LabVIEW Returns Incorrect Timestamp

Primary Software: LabVIEW Development Systems>>LabVIEW Professional Development System
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
When I use the Get Date/Time in Seconds function in LabVIEW, I always get the wrong timestamp. Why is this, and how can I resolve this issue?


Solution:
This issue is explained in a Microsoft Windows Knowledge Base article linked below. Some Windows-based applications add a registry key called TZ (time-zone) which will modify the time-zone offset.  LabVIEW uses the Microsoft C runtime (CRT) library and is therefore affected by this issue.  If the TZ registry key is added to the registry, LabVIEW may return the incorrect time stamp.

The patch included in the linked article will not always resolve the issue. In order to remedy the incorrect timestamp, open the Registry Editor in Windows.  The Registry Editor can be accesses by clicking Start and navigating to Run.  In the Run dialog, type regedit.exe.  Editing the registry can cause unexpected trouble and is only recommended for experienced users.

Make a back-up of your registry by clicking File»Export and save the file to a network drive or a flash drive.

Browse to the following registry locations and delete the TZ key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment
 
HKEY_CURRENT_USER\Environment
 
After making these changes, close the registry editor, and restart your computer. The changes will not take effect until the computer is restarted.


Related Links:

External Link: Microsoft Help and Support: Windows-based applications that use the TZ environment variable may not work as expected



Attachments:





Report Date: 09/04/2008
Last Updated: 09/19/2008
Document ID: 4P3EGEP9

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit