05-14-2010 12:59 PM
In the attached VI my hour input to the "Date/Time to Seconds" function is 11, yet the ouput is 12:09. Why is it 12:09 and not 11:09?
Thank you.
Solved! Go to Solution.
05-14-2010 01:03 PM
Daylight savings time?
Ben
05-14-2010 01:08 PM
Is there an easy way to account for Daylight Savings Time when using this function other than looking at the month and day of the year and making adjustments as required?
Thank you.
05-14-2010 01:14 PM - edited 05-14-2010 01:20 PM
Pull your cluster down by one more and Select Item > Numeric 10. Set that to -1.
05-14-2010 01:15 PM - edited 05-14-2010 01:16 PM
I just looked at the detailed help on this function. It does convert to the local time zone for your computer. So it adjusts for DST. I don't think it should if you have a cluster wired in. If you wire in 11:00, it should otuput 11:00.
The help says that it converts a cluster of time values into a timestamp measured as the number of seconds since blah blah blah. But if you wire in a date time rec cluster, it doesn't output the number of seconds since blah, it outputs a timestamp of the cluster you wired in. This function is misnamed and its help is ambiguous, if not just plain wrong.
It really does not convert Date/Time to Seconds. Its output is a timestamp, not the number of seconds since blah. The number of seconds since blah would be a large integer, like 3,456,789 or something. The output is not an integer, it is a timestamp. So the name is very misleading.
Also if you do not wire in the cluster, you will get a timestamp of the current time, but if you wire in a cluster, you get a timestamp of the time described by the cluster. The help screen does not mention this at all.
05-14-2010 01:16 PM
chuck72352 wrote:Is there an easy way to account for Daylight Savings Time when using this function other than looking at the month and day of the year and making adjustments as required?
Thank you.
ASide from using the inverse function to test the date, I think not.
THe rules about DST are dicated by US govt law and as such it is arbitrary and can change any time the politicians change their mind.
So it is actually implmented in the OS.
I would love to hear about an easier way.
Ben
05-14-2010 01:20 PM
05-14-2010 01:24 PM
Tried which idea? If you are talking about my idea above, position 10 in the Cluster is "is DST", look at the help. The only way to make it make sense would be to name the cluster elements properly, as NI should have done, so the names will get propigated to the Unbundle.
chuck72352 wrote:
I tried that and it works, but I have no idea why or how it works.
05-14-2010 01:28 PM
I'm beginning to like the tags. I recalled a DST issue that I commented in:
http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=414604
James Hillman (used to be NI?) provides some thoughts...
05-14-2010 01:33 PM