Skip to main content
Solved

Custom datetime

  • March 27, 2024
  • 1 reply
  • 222 views

Forum|alt.badge.img+3

Hi, I have this formula from blue prism: FormatDate(ToDate(FormatDate(Today(),"01/MM/yyyy")) - MakeTimeSpan(2, 0, 0, 0), "dd.MM.yyyy"). I want to replicate it in Automation Anywhere,for this I am using:
 

  

Line 76: And in the second action, 'Datetime: Assign', the setup used is this:

 

But, I am getting this System Error: 

 

 

Best answer by Anand77

To extract the last day of the previous month from the current input date, follow these steps.

  1. Extract the month and year from the input date in the format MM/yyyy.
  2. Concatenate "01/" with the extracted month and year to form the first day of the same month.
  3. Convert this concatenated string to a DateTime object.
  4. Subtract one day from this Date Time object using the subtraction action from the Date Time package.
  5. The resulting date will be the last day of the previous month.

 

 

Input - 27-03-2024.

 

View original
Did this topic help answer your question?

1 reply

Forum|alt.badge.img+2
  • Cadet | Tier 2
  • 2 replies
  • Answer
  • March 27, 2024

To extract the last day of the previous month from the current input date, follow these steps.

  1. Extract the month and year from the input date in the format MM/yyyy.
  2. Concatenate "01/" with the extracted month and year to form the first day of the same month.
  3. Convert this concatenated string to a DateTime object.
  4. Subtract one day from this Date Time object using the subtraction action from the Date Time package.
  5. The resulting date will be the last day of the previous month.

 

 

Input - 27-03-2024.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings