fromdatetime(X;Y)
Formats a date+time in the form
XXXX.YYYYYYYYYYY
as a string according to a
template.
(Available as of version 15.19)
Syntax
fromdatetime(X;Y)
Input
Argument | Type | Description |
---|---|---|
X |
decimal | A scalar value or the name of a column
containing date-related values Valid values can be of the form:
|
Y |
text | A "template" string specifying how the output should be formatted The following is a partial list of string templates:
|
Return Value
Returns a string value of the date formatted using the template specified in the
Y
argument.
For more information about date formats, see Dates and time.
Example
The following example first uses datetime(X;Y)
to create a
date+time value from two columns in the
pub.demo.weather.wunderground.observed_hourly table:
date
and time
. The date+time value
appears in the Observed Date/Time column.
Then, fromdatetime(X;Y)
converts the date+time value
into a string value in the form 'YYYY-MM-DD HH24:MI:SS'
. This string value
appears in the Observed Date/Time (string) column.
<base table="pub.demo.weather.wunderground.observed_hourly"/> <sel value="(zipcode='10017')"/> <willbe name="observed_date_time" value="datetime(date;time)" label="Observed Date/Time" format="type:datehms24"/> <willbe name="observed_date_time_string" value="fromdatetime(observed_date_time;'YYYY-MM-DD HH24:MI:SS')" label="Observed Date/Time (string)"/> <colord cols="date,time,observed_date_time,observed_date_time_string"/>