Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date & time field conversion
Message
 
 
To
13/02/2008 01:16:02
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01292048
Message ID:
01292130
Views:
19
Hi neil,

Code below should get you started
* Pick a date as base date. {^1900/01/01} will do 
ldBaseDate = {^1900/01/01}
* Calculate Adjustment value
lnAdjustment = 728952 - ({^1995/03/10} - ldBaseDate)
* 
lnDate = 728952
lnTime = 57395
* Calculate Date and DateTime
ldDate = ldBaseDate + (lnDate - lnAdjustment) 
ltDateTime = DTOT(ldBaseDate + (lnDate - lnAdjustment))  + lnTime
> I am in the middle of doing data conversions from an old DOS legacy system into VFP.
> The problem I have is the DOS DB stores Dates as an integer in julian format i.e. 03/10/1995 = 728952 (English date format), and time is stored as the number of seconds since midnight i.e. 15:56:35 = 57395.
>
> What is the easiest way to get both these fields into a VFP DateTime field.
> Also, what would be the easiest way to convert just a date into a date field.
>
>Thanks in Advance - Brain Dead & going around in circles.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform