1) If I COPY a Year, Month, Day, Hour, Minute, Second into a UDT, but don't know what DayOfWeek that is
to copy in, the DayOfWeek will remain at 0 (SUN).
Currently, I can DT2EPOCH and then EPOCH2DT to get the DayOfWeek calculated and put back into the UDT. Is
there another method of finding the DayOfWeek?
2) With the above, I can now calculate the Spring And Fall DST times in a MATH instruction as a DINT,
either as Greenwich Mean Time (or whatever it's called these days - UTC? UTC seems to get used to mean
the DINT of whatever time zone you want?) Local DINT then EPOCH2DT gets the 2AM change times. Offsetting
by timezone for March and timezone - 1 hour then EPOCH2DT for GMT gets UTC times I don't have to worry
about funny loops that falling back an hour can create. Note: I am using the DINT of the GMT UTC
(whatever!) in a MATH to set/reset $SummerTime.
3) Now an oddity. I can use SETTIME and a UDT to set the clock, either Local or GMT at any time in
ladder. I can't set the clock in the roughly one hour area just before the fall DST end from PLC > Set
PLC CLock... DmD is playing some kind of game setting the local time and I wind up an hour off on the GMT
time. Of course this is only happening during that 1 hour-ish DST End time. The $SummerTime state,
ticking the "Daylight Savings (sic) Time (+1hr)" tick box, and the time entered into the manual settings
all seem to play into this. Regardless, I cannot set the correct time in DmD just before DST ends using
any DST code I have tried to automatically adjust $SummerTime.
4) Just how does the Do-more calculate the day of week? I didn't have much luck finding any actual procedure
online as to how any of the Epoch to Date conversions are made either way.
5) The code in the screenshot is random available element grabs while I was testing this. This is DmD 2.3
because I'm waiting on 2.6.x to flash my test PLCs.