DateTime转化为int类型
我就是想知道两个DateTime类型的数据相减,获得一个几秒。
请问有相关的函数吗?
如果没有相关的函数,怎么处理。
#include "DateUtils.hpp"
extern PACKAGE int __fastcall YearsBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE int __fastcall MonthsBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE int __fastcall WeeksBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE int __fastcall DaysBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE __int64 __fastcall HoursBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE __int64 __fastcall MinutesBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE __int64 __fastcall SecondsBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE __int64 __fastcall MilliSecondsBetween(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall YearSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall MonthSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall WeekSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall DaySpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall HourSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall MinuteSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall SecondSpan(const System::TDateTime ANow, const System::TDateTime AThen);
extern PACKAGE double __fastcall MilliSecondSpan(const System::TDateTime ANow, const System::TDateTime AThen);