L limestone Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-03 #1 时间格式总是包含默认的年份如何只取到时间而不要年份呢?
坏 坏蟑螂 Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-03 #2 假如你 的时间字段叫TimeField, 需要时间数据的变量叫Time1, Time1 := Frac(Table1.FieldByName('TimeField').AsDateTime);
坏 坏蟑螂 Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-03 #3 或者 var wYear, wMonth, wDay, wHour, wMin, wSec, wMS: Word; begin DecodeDate(Table1.FieldByName('TimeField').AsDateTime, wYear, wMonth, wDay); DecodeTime(Table1.FieldByName('TimeField').AsDateTime, wHour, wMin, wSec, wMS); end;
或者 var wYear, wMonth, wDay, wHour, wMin, wSec, wMS: Word; begin DecodeDate(Table1.FieldByName('TimeField').AsDateTime, wYear, wMonth, wDay); DecodeTime(Table1.FieldByName('TimeField').AsDateTime, wHour, wMin, wSec, wMS); end;