Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adir() and daylight saving
Message
De
09/11/2022 12:21:00
 
 
À
09/11/2022 08:25:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01685270
Message ID:
01685273
Vues:
45
>Hi!
>
>I've developed a Tool, that looks in some Directories and stores Filenames and Dates (result of adir()) in an Table.
>If one File changes, i set a Flag and some other Stuff follows...
>
>Well now the daylight Saving Time in Germany has ended.
>And WOW adir() now say's every File has a changed fileTime. (1 hour).
>WTF? adir() why are you so stupid?
>Any suggestions to solve this wired stuff?

Jörg,

Other than what Martina and Tore already suggested, and to continue to base your code on ADIR(), you may consider using the UTCDatetime library at https://github.com/atlopes/UTCDatetime to convert local datetime values into UTC.

To prepare:
DO LOCFILE("utc.app")
_Screen.Utc.SetTimezone("Europe/Berlin")
When you need to insert a datetime into your table, insert it as UTC. After grabbing the datetime value from columns 3 and 4 of the ADIR() array, instead of
..., m.FileDatetime, ...
use
..., _Screen.Utc.UTCTime(m.FileDatetime), ...
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform