ph_tounixtime PowerHome formula function
Description
Converts a PowerHome datetime
value to a standard Unix time value (number of seconds past
midnight, Jan
1, 1970)
Syntax
ph_tounixtime ( adt_datetime, ai_utcoffset )
Argument | Description |
adt_datetime | Datetime. The PowerHome DateTime value you
wish to convert to Unix time |
ai_utcoffset | Integer. The offset from UTC (Coordinated
Universal Time) in minutes to be applied to the
calculation (Unix time is stored as UTC) |
Return value
Double. Converts the PowerHome DateTime
value in adt_datetime to a standard Unix time value and applying the current
timezone offset in ai_utcoffset so that the resulting value is the number of
seconds past midnight, Jan
1, 1970 UTC
Usage
Use this function to convert a
PowerHome DateTime value to a standard Unix
time value
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_tounixtime(datetime(date("05/07/2020"),time("16:41:32")),
-300) - Returns a standard Unix time value of 1588887692. The
ai_utcoffset value of -300 assumes being in the Eastern US
timezone