GMT details
gmtBaseYear: NAT ~ 1968; -- really should come from BasicTime, but it's not exported
gmtCorrection:
CARD32 ~ 63158400;
( ((unixBaseYear-gmtBaseYear)*365+1) * 24*60*60 ); - 1968 was a leap year
GMTDOWN:
PUBLIC
PROC [ gmt: BasicTime.
GMT ]
RETURNS [ secs:
CARD32 ] ~ {
secs ¬ LOOPHOLE[gmt];
};
GMTUP:
PUBLIC
PROC [ secs:
CARD32 ]
RETURNS [ gmt: BasicTime.
GMT ] ~ {
gmt ¬ LOOPHOLE[secs];
};
ToGMT:
PUBLIC
PROC [ time:
UXTIME ]
RETURNS [ gmt: BasicTime.
GMT ] ~ {
gmt ¬ GMTUP[DOWN[time] + gmtCorrection];
};
FromGMT:
PUBLIC
PROC [ gmt: BasicTime.
GMT ]
RETURNS [ time:
UXTIME ] ~ {
time ¬ UP[GMTDOWN[gmt] - gmtCorrection];
};
}.