如何把日期转为16进制数据

解决方案 »

  1.   

    var
      present:TDateTime;
      year,month,day,hour,minute,second,mm,week:word;
      buf1:array[0..50] of byte;
    begin
      present := Now;//获取当前时间
      DecodeDate(present,year,month,day);
      Decodetime(present,hour,minute,second,mm);
      week := dayofweek(present) - 1;
      s:=LengthStr(TelNum,12);
      buf1[0]:=strtoint('$'+ inttostr(year));
      buf1[1]:=strtoint('$'+ inttostr(month));
      buf1[2]:=strtoint('$'+ inttostr(day));
      buf1[3]:=strtoint('$'+ inttostr(hour));
      buf1[4]:=strtoint('$'+ inttostr(minute));
      buf1[5]:=strtoint('$'+ inttostr(second));
      buf1[6]:=strtoint('$'+ inttostr(week));
      ...
    end