Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert VCX Timestamp column?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01673725
Message ID:
01673742
Views:
44
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform