Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert VCX Timestamp column?
Message
From
18/03/2020 16:29:45
 
 
To
18/03/2020 16:16:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01673725
Message ID:
01673727
Views:
47
Thanks Tore! That was fast and exactly what I needed!

>>Hi all,
>>
>>Does anyone have the formula to convert a Timestamp column into a actual datetime value? I seem to have nuked a setting in a class and I am trying to figure out how far back in backups to go to figure out the setting.
>>
>>Thanks,
>>Albert
>
>
>Procedure DecodeTimeStamp(nTimestamp As Number) As Datetime 
>   && see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/filetimetodosdatetime.asp
>   nDate=Bitrshift(nTimestamp,16)
>   nTime=Bitand(nTimestamp,2^16-1)
>   nYear=Bitand(Bitrshift(nDate,9),2^8-1)+1980
>   nMonth=Bitand(Bitrshift(nDate,5),2^4-1)
>   nDay=Bitand(nDate,2^5-1)
>   nHr=Bitand(Bitrshift(nTime,11),2^5-1)
>   nMin=Bitand(Bitrshift(nTime,5),2^6-1)
>   nSec=Bitand(nTime,2^5-1)
>Return Datetime(nYear,nMonth,nDay,nHr,nMin,nSec)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform