LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

Hi to everybody.

In the following link:

http://digital.ni.com/public.nsf/allkb/0ED147D1507C183F862574BA0070AF06?OpenDocument

is written how to solve the problem found when getting wrong time stamp.

In my application Im saving data in TDMS file; when i read tdms data with Ms Excel, the time is esactly 1 hour ahead if data are read by another computer.

Time is correct if data are read by the same computer that saved tdms files.

So I fellow suggestion from the link, but in Windows registers I didnt find any TZ key.

Im using old Ms Windows Xp profesasional, version 2002, Service pack 2.

Does anybody have some suggestion for this issue?

Thank you alot

Ant

0 Kudos
Message 1 of 9
(5,408 Views)

This sounds like a Daylight Savings Time issue.  I've seen that too when moving code from one computer to another and the modified data/time is off by 1 hour.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(5,402 Views)

You have the option to select DST on these functions. Make you you set it to a values that works for your software. Maybe the other computer never got the patch to change to the new daylight savings model.

 

You could make it look at Windows and determine if the computer is using this offset. I do agree with crossrulz.

Tim
GHSP
0 Kudos
Message 3 of 9
(5,395 Views)

Thank you, Tim.

But where to set Daylight saving time? In control panel or in the registers?

0 Kudos
Message 4 of 9
(5,384 Views)

It is in the date and time to seconds function. See below:

 

example.png

Tim
GHSP
0 Kudos
Message 5 of 9
(5,380 Views)
Solution
Accepted by Yixiao-uncle

I tried to use suggestions from forum but all results were unsuccessful.

Anyway I solved problem and I want to share this with other Lv users.

I noticed that in computer used for acquiring and saving TDMS file, the showed time is correct but the time zone was wrong (I live in +1, and pc was set on +0)

The notebook I use for reading tdms data is properly set to +1.

When I aligned time zones, the problem disappeared.

Bye

0 Kudos
Message 6 of 9
(5,348 Views)

You should mark your answer as the solution so the everyone knows that it has been solved.

 

Thanks for sharing your solution with the rest of us.

Tim
GHSP
0 Kudos
Message 7 of 9
(5,340 Views)

Hi aeastet,

 

How did you get this time in seconds, minutes hour etc? I cant see this in timing.

0 Kudos
Message 8 of 9
(4,176 Views)

@jooe7788 wrote:

Hi aeastet,

 

How did you get this time in seconds, minutes hour etc? I cant see this in timing.


I am not sure that I understand what you are asking. The snipt above can be dropped right into your code and it will work. Just click on the picture and drop it on your block diagram.

 

I hope that helps.

 

Tim

Tim
GHSP
0 Kudos
Message 9 of 9
(4,170 Views)