06-13-2014 03:31 AM
Hello all!
I have developed a VI that adjusts the time depending on whether the time is in a DST period or not.
I just wanted to get some opinions on it and see whether there are any suggested improvements.
Cheers
Chris
06-13-2014 08:36 AM
It looks like you are trying to solve a problem here that doesn't really exist. While the underlaying timestamp value is always in "seconds since Jan 1, 1904 GMT" the default display time of a timestamp control (and also the string format as well) is already formatted as local time, which includes DST if that applies for the timestamp in question. So all you are really doing here is to adjust the already adjusted timestamp again.
So what are you really trying to fix here?
06-16-2014 07:07 AM
06-16-2014 08:51 AM
You could simplify that vi just a bit.
06-16-2014 01:56 PM
Jeff,
Unfortunately the older cRIO (most likely the NI Linux one would be different) don't really have DST handling so I doubt that the DST value is actually valid. It could even be -1 which has a special meaning when used as input to the Data/Time To Seconds, telling the LabVIEW system to determine the DST status for the timestamp based on its date, but because of the limitations on older sRIO's that likely won't work either.
06-23-2014 06:18 AM
Thanks for the responses.
Rolf,
Presumably, based on the additional detail that i gave, your opinion is that the solution i propose is suitable?
Cheers
Chris
06-23-2014 07:19 AM - edited 06-23-2014 07:20 AM
personally I would hesitate to follow that approach. This kind of thing is difficult to fully test, likely to fall apart over a few years when the next change to DST is decided by your goverment or your company decides to sell a copy of the product to another country and generally a big hackaround anyways. But if you are happy to live with these limitations, I'm not ging to stop you to do it this way.
06-27-2014 07:07 AM
Thanks Rolf, appreciate the feedback. I appreciate the limitations you have raised and agree they could cause a headache.
Have you got any suggestions to improve it/ideas to start from scratch!?
Cheers
Chris