defcon.klaxon
Lifetime Supporting Member
I'm working on some code that timestamps certain functions, and I've noticed that the hours value is +7 in the tag I'm using for time, but it displays the correct time when I go to the PLC's properties (Date/Time tab). This is on both a ControlLogix and CompactLogix PLC.
The "Date and Time" display on the Date/Time tab has the correct local time; my timezone is UTC-08:00 for Pacific time, and I have the box checked for Adjust for Daylight Saving. Time Synchronization is currently not enabled, I'm going to tackle that later.
The way I grab time is through a GSV (Class Name is WallClockTime, Attribute Name is DateTime, Destination is a UDT I made for Year, Month, Day, Hour, Minute, and Second). All other values come in just fine (Year/Month/Day, and Minute/Second) so it seems like for some reason, the hour is ignoring my time zone offset and daylight saving time offset and it going off of UTC.
Any ideas for why it's doing this, and how I can get my hour tag to have the proper value without manually offsetting its value? My guess is that I'm grabbing the info from the wrong source.
The "Date and Time" display on the Date/Time tab has the correct local time; my timezone is UTC-08:00 for Pacific time, and I have the box checked for Adjust for Daylight Saving. Time Synchronization is currently not enabled, I'm going to tackle that later.
The way I grab time is through a GSV (Class Name is WallClockTime, Attribute Name is DateTime, Destination is a UDT I made for Year, Month, Day, Hour, Minute, and Second). All other values come in just fine (Year/Month/Day, and Minute/Second) so it seems like for some reason, the hour is ignoring my time zone offset and daylight saving time offset and it going off of UTC.
Any ideas for why it's doing this, and how I can get my hour tag to have the proper value without manually offsetting its value? My guess is that I'm grabbing the info from the wrong source.