Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date & time field conversion
Message
 
 
À
13/02/2008 01:16:02
Neil Mc Donald
Cencom Systems P/L
The Sun, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01292048
Message ID:
01292130
Vues:
20
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform