Methods for DateTime variables
Methods for DateTime variables enable manipulation of dates within your automations.
Methods
Method | Description | Parameters | Result type |
Add | Adds timespan to the variable and returns the variable DateTime value. | TimeSpan | DateTime: Returns an object whose value is the sum of the date and time represented by this instance and the time interval. |
AddDays | Adds days to the variable and returns the variable DateTime value. | Double | DateTime: An object whose value is the sum of the date and time represented by this instance and the number of days added. |
AddHours | Adds hours to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time represented by this instance and the number of hours added. |
AddMilliseconds | Adds milliseconds to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time plus the milliseconds added. |
AddMinutes | Adds minutes to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time plus the minutes added. |
AddMonths | Adds months to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time plus the months added. |
AddSeconds | Adds seconds to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time plus the seconds added. |
AddTicks | Adds ticks to the variable and returns the variable DateTime value. | Double | DateTime: The sum of the date and time plus the ticks added. |
CompareTo | Compares the value of this instance to a specified DateTime value and indicates whether this instance is earlier than, the same as, or later than the specified DateTime value. Enumeration is BeforeDate2, EqualToDate2, AfterDate2, Invalid. | DateTime | Int32: A signed number indicating the relative values of this instance and the variable. |
Equals | Returns a value indicating whether two DateTime instances have the same date and time value. | Double | Boolean: Returns True if the two values are equal. |
Now | Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time. | None | DateTime |
Parse | Converts the string representation of a date and time to its DateTime equivalent. | String: the date and time to convert | DateTime |
ParseExact | Converts dates that are in a string format and are formatted for another culture into a DateTime. For example, you can convert a date in dd-mm-yyyy format to a DateTime by specifying the format parameter. This method converts the specified string representation of a date and time to its DateTime equivalent using the format and culture, or locale, information that you specify. The format of the string representation must match the specified format exactly. You can define the culture parameter by selecting the locale from a list or entering it, such as en_us for US English or fr_ca for Canadian French. | input, format, culture | DateTime |
ResetState | Resets all component properties to their initial values. | ||
Subtract | Returns the result from subtracting the specified time or duration from the value of this instance. | DateTime | TimeSpan: Interval equal to the date and time of this instance minus the date and time of the variable. |
Today | Gets the current date. | None | DateTime |
ToLongDateString | Converts the value of the current DateTime object to its equivalent long-date-string representation. | String | |
ToLongTimeString | Converts the value of the current DateTime object to its equivalent long time string representation. | String | |
ToShortDateString | Converts the value of the current DateTime object to its equivalent short date string representation. | String | |
ToShortTimeString | Converts the value of the current DateTime object to its equivalent short time string representation. | String | |
ToString | Converts the value of the current DateTime object to its equivalent string representation. | String IFormatProvider | String: the value of the current DateTime object as specified. |
TryParse | Performs the TryParse action. If True, assigns the value to the variable and then outputs that value. | ||
UtcNow | Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC). | None | DateTime |
WeekOfYear | Gets the week of the year component of the date for the input value. | DateTime Value | Int32 |
Previous topic Methods for sensitive variables Next topic Methods for character variables