var dt:TDateTime; Year,Month,Day,Hour,Min,Sec,MSec:Word; aa:array[0..5] of byte; begin dt:=Now; DecodeDate(dt,Year,Month,Day) DecodeTime(dt,Hour,Min,Sec,MSec); Year:=Year mod 100; aa[0]:=Byte(Sec); aa[1]:=Byte(Min); aa[2]:=Byte(Hour); aa[3]:=Byte(Day); aa[4]:=Byte(Month); aa[5]:=Byte(Year); end;
但是我们的2005年怎么保存进去那,搂主!!!?
dt:TDateTime;
Year,Month,Day,Hour,Min,Sec,MSec:Word;
aa:array[0..5] of byte;
begin
dt:=Now;
DecodeDate(dt,Year,Month,Day)
DecodeTime(dt,Hour,Min,Sec,MSec);
Year:=Year mod 100;
aa[0]:=Byte(Sec);
aa[1]:=Byte(Min);
aa[2]:=Byte(Hour);
aa[3]:=Byte(Day);
aa[4]:=Byte(Month);
aa[5]:=Byte(Year);
end;
1905-------------->05
……
2105-------------->05