" > BLib.Time 1.03 12-Aug-2006 ! RTC Time and date functions : (C)J.G.Harston, may be freely used and redistributed (: ---------------------------------------------------- 2/ All functions assume global control block <0 pointed to by X%,Y% and set up as follows: F( DIM ctrl% 31:X%=ctrl%:Y%=X%DIV256 P: Z: d' Real-Time-Clock reading functions n' ================================= x: H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I FNtime - return RTC time&date or null string if none present L returned date is correct for years after 1996 and 1999 : (ݤtime:?X%=0:A%=14:&FFF1:?X%=0:="" X%?24=13:A%=$(X%+4):$(X%+4)="0"+(A%31),2):$(X%+11)=($(X%+11)+(A%&E0)2-100*($(X%+11)<1981)):X%?6=32:X%?15=46:=$X% : H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C FNTime - Return time&date or null string if none found A On-board RTC and fileserver RTC are checked 0 and day of week calculated : 6ݤTime:!X%=1:A%=14:&FFF1:A%=07:X%?A%=~X%?A%: time:year%=0:month%=0:day%=0:hour%=0:minute%=0:second%=0 A%=14:!X%=1:&FFF1:!X%=1: A%=07:X%?A%=~X%?A%: 2((y%4)=0(y%100)<>0y%=0))+3)7+1 : #ݤd0(A%,N%)="00000000"+A%,N%)