Get action in Datetime
- Updated: 2024/07/15
Get action in Datetime
The Get action in the Datetime package retrieves the information such as year, month, hour, minute, second and so on from the given Datetime value and stores the result in a variable
To get a value from a Datetime variable, do the following:
- Double-click or drag the Get action from the Datetime package in the Actions palette.
- Select either the Datetime or
Variable tab from the Date time
variable to get the selected value field:
- Datetime: Select the date, time, and timezone values from the dropdown.
- Variable: Select a Datetime variable.
- In the Datetime value to get field, choose from the
following options to retrieve a specified date and time value:
- Day of month: Retrieves the day of the month
- Day of week: Retrieves the day of the week
- Day of year: Retrieves the day of the year
- Length of month: Total number of days in a month
- Length of year: Total number of days in a year (365 or 366 days, if leap year)
- Hour: Retrieves the hour(s)
- Minute: Retrieves the minute(s)
- Month: Retrieves the month
- Second: Retrieves the second(s)
- Year: Retrieves the year
- Select the number variable from the Assign the output to a variable field to assign the output.
Example of using Get action in an automation
In this example, you will create an automation that retrieves the specified date and time value from a Datetime variable and stores the output in a variable.