aus den XbTools zu tun.
ot4xb verwenden will.
das Problem sind die 2 x 32bit DWORD die zusammen das Datum ergeben.
Beispiel : January 1, 1601 (UTC) -> 150183 days, 9 hours, 45 minutes, 3 seconds and 180 thousands, they should be about:
wenn du das jetzt "selbst" hin-her rechnen willst ... in ot4xb gibt es die entsprechenden Funktionen
Code: Alles auswählen
XPPRET XPPENTRY wapist_FILETIME64( XppParamList pl ) // <doc!xb!!|CLASS{FileTime}from{gwst}| />
{
ContainerHandle conco = _conClsObj("FILETIME64");
if( conco == NULLCONTAINER )
{
TXbClass * pc = new TXbClass;
pc->ClassName("FILETIME64");
pc->GwstParent();
pc->EXPORTED();
pc->GwstReadWrite();
// ---------------------------
pc->Member_DWord("dwLowDateTime"); // <doc!xb!!|ivar{FileTime:dwLowDateTime}|short{}| />
pc->Member_DWord("dwHighDateTime"); // <doc!xb!!|ivar{FileTime:dwHighDateTime}|short{}| />
// ---------------------------
pc->GwstSetOffset(0);
pc->Member_DWord64("qft");
// ---------------------------
pc->MethodCB("SetTimeStamp","{|s,c,sh| ft64_SetTs(s,c,@sh),s}");
pc->MethodCB("_GetTimeStamp_","{|s,f| ft64_GetTs(s,f)}");
pc->MethodCB("GetTimeStamp","{|s| ft64_GetTs(s)}");
pc->MethodCB("GetTimeStamp19","{|s| ft64_GetTs(s)}");
pc->MethodCB("GetTimeStamp14","{|s| ft64_GetTs(s,'%04.4hu%02.2hu%02.2hu%02.2hu%02.2hu%02.2hu')}");
pc->MethodCB("GetIso8601","{|s| ft64_GetTs(s,'%04.4hu-%02.2hu-%02.2huT%02.2hu:%02.2hu:%02.2hu')}");
pc->PropertyCB("cTimeStamp","{|s,v| iif(PCount() > 1,ft64_SetTs(s,v),ft64_GetTs(s))}");
pc->MethodCB("SetDateTime","{|s,d,t| ft64_SetDateTime(s,d,t),s}");
pc->MethodCB("GetDateTime","{|s,d,t| ft64_GetDateTime(s,@d,@t),s}");
pc->MethodCB("GetDateTimeSec","{|s,d,t| ft64_GetDateTimeSec(s,@d,@t),s}");
pc->MethodCB("Now","{|s,lLocal| ft64_Now(s,lLocal),s}");
pc->MethodCB("NowL","{|s| s:Now(.T.) }");
pc->MethodCB("ElapMilliSeconds","{|s,t2,lLocal| ft64_ElapMilliSeconds(s,t2,lLocal)}");
pc->MethodCB("ElapMilliSecondsL()","{|s,v| s:ElapMilliSeconds(v,.T.) }");
pc->MethodCB("ElapSeconds","{|s,t2,lLocal| ft64_ElapSeconds(s,t2,lLocal)}");
pc->MethodCB("ElapSecondsL","{|s,v| s:ElapSeconds(v,.T.) }");
pc->MethodCB("Compare","{|s,t2| ft64_Compare(s,t2)}");
// ---------------------------
// ---------------------------
pc->MethodCB("Day","{|s| Day(s:dDate)}");
pc->MethodCB("Month","{|s| Month(s:dDate)}");
pc->MethodCB("Year","{|s| Year(s:dDate)}");
pc->PropertyCB("dDate","{|s,v| iif(PCount() > 1, s:SetDateTime(v) ,s:GetDateTime(@v)),v}");
pc->PropertyCB("cTime","{|s,v| iif(PCount() > 1, s:SetDateTime(,v) ,s:GetDateTime(,@v)),v}");
pc->PropertyCB("nTime","{|s,v| iif(PCount() > 1, s:SetDateTime(,v) ,s:GetDateTimeSec(,@v)),v}");
// ---------------------------
pc->MethodCB("AddMilliSeconds","{|s,n| ft64_Add(s,n,1),s}");
pc->MethodCB("AddSeconds","{|s,n| ft64_Add(s,n,1000),s}");
pc->MethodCB("AddMinutes","{|s,n| ft64_Add(s,n,60000),s}");
pc->MethodCB("AddHours","{|s,n| ft64_Add(s,n,3600000),s}");
pc->MethodCB("AddDays","{|s,n| ft64_Add(s,n,86400000),s}");
// ---------------------------
pc->MethodCB("AddMonths","{|s,n| Ft64_Add_M(s,n),s}");
pc->MethodCB("AddYears","{|s,n| Ft64_Add_Y(s,n),s}");
// ---------------------------
pc->PropertyCB("cHexTs","{|s,v| iif(PCount() > 1, s:SetHexTs(v) ,s:GetHexTs())}");
pc->MethodCB("SetHexTs" , "{|s,v| iif( ValType(v) =='C',PokeStr(s,0,nHex2Qw(v)),),NIL }");
pc->MethodCB("GetHexTs" , "{|s,v| cQw2Hex( s:qft ) }");
// ---------------------------
pc->MethodCB("SetDosDateTime","{|s,v| Ft64_From_DosDateTime(s,v),s}");
pc->MethodCB("GetDosDateTime","{|s| Ft64_To_DosDateTime(s)}");
pc->PropertyCB("nDosDateTime","{|s,v| iif(PCount() > 1,Ft64_From_DosDateTime(s,v),Ft64_To_DosDateTime(s))}");
// ---------------------------
pc->MethodCB("SetUnixTime","{|s,v| Ft64_From_UnixTime(s,v),s}");
pc->MethodCB("GetUnixTime","{|s| Ft64_To_UnixTime(s)}");
pc->PropertyCB("nUnixTime","{|s,v| iif(PCount() > 1,Ft64_From_UnixTime(s,v),Ft64_To_UnixTime(s))}");
// ---------------------------
pc->MethodCB("SetExcelTime","{|s,v| Ft64_From_ExcelTime(s,v),s}");
pc->MethodCB("GetExcelTime","{|s| Ft64_To_ExcelTime(s)}");
pc->PropertyCB("nExcelTime","{|s,v| iif(PCount() > 1,Ft64_From_ExcelTime(s,v),Ft64_To_ExcelTime(s))}");
// ---------------------------
conco = pc->Create();
delete pc;
if( conco == NULLCONTAINER ){_ret(pl); return;}
}
_conReturn(pl,conco);
_conRelease(conco);
}