Okay... this is an odd one.
This is my current code...
DateTime now = RTC.now();
yearVal = now.year();
monthVal = now.month();
dayVal = now.day();
hourVal = now.hour();
minuteVal = now.minute();
secondVal = now.second();
My application starts with a somewhat accurate local time (Pacific time - non DST). The user has the option of hooking up a GPS. My program then gets the current time (UTC time) But... i need to subtract 8 hours from it and store that back on the RTC.
I set the GPS time in the RTC with this bit of code. It works pretty good...
RTC.adjust(DateTime(GPS.year, GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.seconds));
But... once the RTC has UTC time I need to somehow subtract 8 hours and update the RTC.
I think I need to use the unixtime function and subtract 8 * 3600 from the total number of seconds but I'm still lost... What do ya'll suggest?