extractFromDateTime
Extracts part of a datetime or date.
If the first argument is a date, it is first converted to a datetime with the time set to noon in the local time zone.
Arguments
- Input date or datetime.
- Unit to extract as a string:
- Date for the full date
- Time for the full time
- Year, Years, Y or u for the year
- Month, Months, M or L for the month
- Week, Weeks or W for the week of month
- Week of Year or w for the week of year
- Day, Days or d for the day
- Day of Year or D for the day of year
- Day of Month for the day of month
- Day of Week, e or E for the day of week
- Hour, Hours or H for the hour
- Minute, Minutes or m for the minute
- Second, Seconds or s for the second
- Millisecond, Milliseconds or A for the millisecond
- TimeZone, V or z for the time zone
Examples
Expression | Result |
---|---|
extractFromDateTime("2021-03-21T10:19:26.214+02:00", "Time") | 10:19:26.214 |