DateTime Command

 

RPA | DateTime Command | Automation Anywhere - Part-11

datetime,A2019 datetime,datetime Automation Anywhere,datetime strptime,datetimes,datetime use,use datetime in A2019,datetime package,steps to use datetime,pandas datetime,datetime in python,datetime strftime,python datetimes,python datetime module,datetime module python,how-to use sql datetime,python datetime example,python datetime to string,datetime module in python,python datetime strptime,python datetime to timestamp,python datetime milliseconds,python datetime strptime example,date time,to_datetime,time,times

 DateTime Command | DateTime command is used to provide actions that are used to perform operations on date/time. There are seven sub commands under the date time category.

Let's see the functioning of date time command in detail now.

  • Add Command - This command is used to add a specified time unit to a given date and time.
To add a value to a date time variable, follow the steps as mentioned below:-

  1. Double click or drag the Add action from the DateTime node in the Actions palette.
  2. Select an option from the source date and time variable list to specify the variable that contains the value to which you want to add the time unit.
  3. Enter the value you want to add in the time value to add field.
  4. Select an option from the Time unit to add list to specify the time unit you want to add i.e. you can give the time either in Milliseconds, seconds, Minutes, Hours, Days, Weeks, Months and years.
  5. Select the DateTime variable from the Assign the output to a variable list to specify the variable to which you want to assign the output.
  6. Finally click on Apply.

Here is the code snippet for Add command.



  • Assign Command - This command is used to assign the source datetime variable's value or the user defined value to the destination datetime variable. Here you need to pass the source date time variable as the input and the resultant output will be stored in a datetime variable.
To assign values to the date time variable follow the steps as mentioned below.

  1. Double click or drag the To string action from the Datetime node in the Actions palette.
  2. Select either the Enter the date time or variable option.
  3. If we have selected the Enter date time option then enter the date time values or select a String variable and then finally select the date time format from the prebuilt formats.
  4. If we have selected the variable option, select a variable from the Source date time variable list.
  5. Select the variable to use to store the output from the Destination date time variable list.
  6. Click on Save and then click on Apply.

Here is the code snippet for the Assign command.



  • Is After Command - This command is used to check whether the source date and time is after a specified date and time and returns the result to a variable. The output stored will be of Boolean data type.
Here is the code snippet for Is After command.




  • Is Before Command - This command is used to check whether the source date and time is before a specified date and time and returns the result to a variable. The output stored will be of Boolean data type.

Here is the code snippet for Is Before command.



  • Is Equal Command - This command is used to check whether the source date and time is equal to the specified date and time and returns the result to a variable.The output stored will be of Boolean data type.
Here is the code snippet for Is Equal command.




  • Subtract Command - This command is used to subtract a specified time unit from the given date and time.

To subtract a value to a date time variable, follow the steps as mentioned below:-

  1. Double click or drag the subtract action from the DateTime node in the Actions palette.
  2. Select an option from the source date and time variable list to specify the variable that contains the value to which you want to add the time unit.
  3. Enter the value you want to subtract in the time value to add field.
  4. Select an option from the Time unit to add list to specify the time unit you want to subtract i.e. you can give the time either in Milliseconds, seconds, Minutes, Hours, Days, Weeks, Months and years.
  5. Select the DateTime variable from the Assign the output to a variable list to specify the variable to which you want to assign the output.
  6. Finally click on Apply.
Here is the code snippet for subtract command.




  • ToString Command - This command is used to convert date time value to a string value and store it in the string variable.
Here is the code snippet for ToString command.





I hope you would like this blog on DateTime command. If you have any queries or issues you can post your queries in the comment section of this blog and i will be happy to reach out with the solutions.







Comments

Post a Comment

If you have any doubts, please letme know.