GET_DATETIME_COMPONENT
Get datetime component

Description

For the given datetime, returns the given component: year, month, date, hour, minute, second or millisecond.

Function signature

1
GET_DATETIME_COMPONENT(date: String, component: String) => Number
Copied!
Parameter
Description
Date
Date
Component
Component to get from the date

Examples

Formula
Return value
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+03:00", "year")
2012
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+03:00", "month")
7
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+03:00", "date")
11
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+02:00", "hour")
13
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+01:00", "minute")
6
GET_DATETIME_COMPONENT("2012-07-11T13:06:15+01:00", "second")
15
GET_DATETIME_COMPONENT("2015-12-02T21:45:22.279Z", "millisecond")
279
Export as PDF
Copy link