查help,DateTimeToUnix只能精确到秒,请问各位朋友,有没有精确到毫秒的时间戳函数?Converts a TDateTime value into a Unix/Linux-style date-and-time value.UnitDateUtilsCategorymeasurement conversion routinesDelphi syntax:function DateTimeToUnix(const AValue: TDateTime): Int64;C++ syntax:extern PACKAGE __int64 __fastcall DateTimeToUnix(const System::TDateTime AValue);DescriptionCall DateTimeToUnix to convert a TDateTime value the corresponding Unix/Linux encoding of the same date and time.Unix/Linux date-and-time values are encoded as the number of seconds since midnight at the start of January 1, 1970.
解决方案 »
- 我用的ADOQUERY控件为什么查询不到数据,是不是语句错了?见正文(给分)
- ****高分请教,不够再加,自己定义的控件的属性问题
- WM_MouseMove的问题.急,在线等
- 这样行吗???
- 小弟痛苦中,是学DELPHI与电子商务好,还是学.NET与电子商务好?
- 关于MDIFORM里放IMAGE1问题,急,急 ,急,拜谢了,分不够在给,求救啊
- MDI窗体中,有一个登陆子窗体,怎样使得程序运行时,子窗体是用户可以访问的,而父窗体用户不能访问!在线等!
- kds(生) (▲▲) 信誉:100 ,具体是什么含义?
- 出学的菜鸟提问
- 大家用vcl的图形控件的时候又没有遇到这样的问题.....
- 如何把Dll中的事件引出来呀
- TCP问题
function GetJavaTime( d: TDateTime ): Int64;
var
dJavaStart: TDateTime;
begin
dJavaStart := EncodeDateTime( 1970, 1, 1, 8, 0, 0, 0 );
Result := MilliSecondsBetween( d, dJavaStart );
end;
function GetJavaTime( d: TDateTime ): Int64;
var
dJavaStart: TDateTime;
begin
//java里的时间是从1970年1月1日0点到当前的间隔
dJavaStart := EncodeDateTime( 1970, 1, 1, 0, 0, 0, 0 );
Result := MilliSecondsBetween( d, dJavaStart );
end;
毫秒级的时间戳,上百人的话,重复的概率应该是非常罕见的。
这个是返回int64型,如果截取最后9位转换成integer型,应该不会重复吧?