Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting long integer into date
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01054948
Message ID:
01055051
Views:
18
This message has been marked as the solution to the initial question of the thread.
OK Sergey, I foud how to do that with my FoxPro 8

I found that 56 - 203 - 49 - 1 Should be the May 4th 2004.

I made some tests converting these number in Binary and found that I had to right-switch them and add the result

No need to switch 56 because its the lowest byte

All other value are switched like this...
BITLSHIFT(203,8) && Result 51968
BITLSHIFT(49,16) && Result 3211264
BITLSHIFT(1,24) && Result 16777216

Adding all these results 56+51968+3211264+16777216 = 20040504 and just making some string operation to get 2004/05/04



>Try
CTOBIN(lcStr, "4RS")
>>
>>I have a problem convertin data read from a binary file. I have to import these data into a DBF.
>>
>>Data in the source file where stored by an old DOS based application (may be Pascal or Basic) I know the structure of this file but I have some trouble converting numeric data.
>>
>>For exemple Date are stored in YYYYMMDD format, as a long (4 bytes)
>>
>>Exemple :
>> ASC(byte1) = 56
>> ASC(byte2) = 203
>> ASC(byte3) = 49
>> ASC(byte4) = 1
>>
>>This should be converted to a date.... but HOW ??????
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform