本文整理自网络,侵删。
uses system.DateUtils;
//将Java中的日期转换为Delphi中的日期function ConvertJavaDateTimeToDelphiDateTime(Value: Int64): TDateTime;begin Result := IncMilliSecond(StrToDate('1970-01-01'), Value);end;
//将Delphi中的日期转换为Java中的日期function ConvertDelphiDateTimeToJavaDateTime(ADateTime: TDateTime): Extended;var dt: TDateTime; dtVal: double;begin
if not TryStrToDate('1970-01-01', dt) then begin dtVal := 25569; dt := dtVal; end; Result := MilliSecondSpan(ADateTime, dt);end;
相关阅读 >>
Delphi yesterday、today、tomorrow - 昨天、今天、明天
Delphi webbrowser设置自己定义user-agent
Delphi 实现卸载windows应用程序(类似360软件管家-卸载程序)
更多相关阅读请进入《Delphi》频道 >>