Skip to content

getDateTime(mixed datetime)

The getDateTime method is used to get a DateTime object that represents given date.

Input parameters

datetime

mixed Numeric timestamp of a given date or iso8601 date string.

Returned value

The DateTime object.

Example

source
{% set datetime = ObjectApi.getDateTime("2022-06-13 12:30:15") %}
{{ datetime.dateTimeLong }}
output
Monday, 13 June 2022 12:30:15