Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FileTime structure
Message
De
24/01/2006 05:25:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/01/2006 02:51:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01089646
Message ID:
01089662
Vues:
10
>I use SmartFTP Library in my application.
>After connection, I use objitem.date, and this methode return a number like 38741.3520833333300. SmartFTP help says: objitem.date "Returns the date of the item as a date/double". How can I obtain date an time when file was created or modified?
>Also, there is a method - objitem.FileTime wich "Returns the time of the item as a FILETIME struct". How can I use this to obtain date and time when file was created/modified?
>
>Regards,
>Andrei
? num2time(38741.3520833333300)

Function Num2Time
Lparameters tnFloat
Return Dtot({^1899/12/30}+Int(m.tnFloat))+86400*(m.tnFloat-Int(m.tnFloat))
For filetime:
DECLARE SHORT FileTimeToSystemTime IN Win32API;
  STRING @lpft,	STRING @lpst

DECLARE SHORT FileTimeToLocalFileTime IN Win32API;
  STRING @lpFileTime, STRING @lpLocalFileTime


function _DecodeFileTime
lparameters tcFileTime, tnMillis
local lcLocalTime, lcSysTime, lnResult, ltTime
ltTime = {/:}
Store REPLICATE(CHR(0), 16) to lcLocalTime, lcSysTime
if FileTimeToLocalFileTime(@tcfiletime, @lcLocalTime) # 0 and ;
	FileTimeToSystemTime(@lcLocalTime, @lcSysTime) # 0
		ltTime = Datetime(Str2Val(substr(lcSysTime,1,2)), ;
			Str2Val(substr(lcSysTime, 3,2)),;
			Str2Val(substr(lcSysTime, 7,2)),;
			Str2Val(substr(lcSysTime, 9,2)),;
			Str2Val(substr(lcSysTime,11,2)),;
			Str2Val(substr(lcSysTime,13,2)) )

	tnMillis = Str2Val(substr(lcSysTime,15,2))
endif
Return ltTime

Function Str2Val
Lparameters tcStr
Local lnVal
lnVal = 0
for ix=1 to len(tcStr)
	lnVal = lnVal + asc(substr(tcStr,ix,1))*256^(ix-1)
endfor
return lnVal
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform