Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert VCX Timestamp column?
Message
De
19/03/2020 13:55:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01673725
Message ID:
01673743
Vues:
54
>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.

This time format is unrelated to VCX timestamp format. But it doesn't hurt to know. I needed it recently to connect to some REST API which wanted to have it as part of the authentication string (UTC, of course).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform