ph_datetime PowerHome formula function
Description
Takes date and time values stored within a string and returns it as a datetime variable.
Syntax
ph_datetime ( s )
Argument |
Description |
s
|
A string containing a date and/or time value.
|
Return value
Datetime. Returns the string parameter
as a datetime value. This parameter should contain a date in the format of
mm/dd/yyyy or mm-dd-yyyy or yyyy-mm-dd without spaces followed by a space and
then the time value in hh:mm:ss format. If you pass only a time value, then the
returned datetime will be Today's date plus the passed time. If the
parameter only contains
a date, you'll get a datetime with a date value of the passed date and a time value of 00:00:00. If the data cannot be interpreted as a datetime, then a datetime value of 1900-01-01 00:00:00 will be returned.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_datetime("2014-12-11 20:54:38") --> evaluates to: 12/11/2014 20:54:38
•
ph_datetime("2014-12-11") --> evaluates to: 12/11/2014 00:00:00
• ph_datetime("20:54:38")
--> evaluates to: 01/14/2015 20:54:38 {today() is implied}
• ph_datetime("1/14/2015") --> evaluates to: 1/14/2015 00:00:00