Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert VCX Timestamp column?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01673725
Message ID:
01673742
Vues:
42
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,

*****

* Example
? UnixTime2Datetime(1579737301.704)
? UnixTime2Datetime(1416003979)
? Datetime2UnixTime(DATETIME())
? Datetime2UnixTime(DATETIME(2014,11,14,10,26,19))


* Convert Unix time to datetime
FUNCTION UnixTime2Datetime(tnUnixTime)
RETURN {^1970/01/01 00:00:00} + tnUnixTime

* Convert datetime to Unix time
FUNCTION Datetime2UnixTime(ttDT)
RETURN ttDT - {^1970/01/01 00:00:00}

Frank

******

Albert,
Somebody had share that function with me. I think it will give you a starting point.

Frank
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform