Andrew Boyson / clock

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Thu Feb 27 13:02:18 2020 +0000
Revision:
73:286a739f7c05
Parent:
58:ad2bfd0345de
Added a method to allow the UTC offset to be changed with a corresponding adjustment to TAI so that the resulting UTC time was not changed. This was used in the clock web page.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 37:330b844f54b6 1 #include <stdint.h>
andrewboyson 26:0421132e6eaf 2 #include <time.h>
andrewboyson 26:0421132e6eaf 3
andrewboyson 37:330b844f54b6 4 #include "tm.h"
andrewboyson 37:330b844f54b6 5 #include "clktime.h"
andrewboyson 54:a3c018ceca77 6 #include "clkutc.h"
andrewboyson 26:0421132e6eaf 7
andrewboyson 58:ad2bfd0345de 8 void ClkTimeToTmLocal(clktime time, struct tm* ptm) { TmLocalFromTime64(ClkUtcFromTai(time) >> CLK_TIME_ONE_SECOND_SHIFT, ptm); }
andrewboyson 58:ad2bfd0345de 9 void ClkTimeToTmUtc (clktime time, struct tm* ptm) { TmUtcFromTime64(ClkUtcFromTai(time) >> CLK_TIME_ONE_SECOND_SHIFT, ptm); }
andrewboyson 58:ad2bfd0345de 10 clktime ClkTimeFromTmUtc( struct tm* ptm) { return ClkUtcToTai(((clktime)TmUtcToTime64(ptm)) << CLK_TIME_ONE_SECOND_SHIFT) ; }