How to get current system date in mm/dd/yyyy format of the prev month based on current date?

Hi guys,

I need help in getting the

  1. Last day of the prev month
  2. Last day of the prev month + 1 day

appreciate if anyone can assist … im new to this

Thank you :slight_smile:

Hi @para90,

use below code

Now.Addmonths(-1).ToString(''MM/dd/yyyy")

Now.Addmonths(-1).AddDays(1).ToString("MM/dd/yyyy")

Regards,
Arivu :slight_smile:

2 Likes

Hi @arivu96

Thanks so much . is this available in xaml file?

1 Like

You can directly use an assign activity @para90

1 Like

Can anyone help me . im stuck.

Hi,

You have to use the above expressions in assign activity, as its shown in below screenshot

image

Hi Anil,

What do i fill in the variables section? it wont run

Hi @para90

Use this workflow

Main.xaml (5.1 KB)

Hi para90,

strLastMonthDate → String variable

Last day of the prev month

strLastMonthDate=Now.Addmonths(-1).ToString("MM/dd/yyyy")

para90:

Last day of the prev month + 1 day

strLastMonthDate=Now.Addmonths(-1).AddDays(1).ToString("MM/dd/yyyy")

Regards,
Arivu :slight_smile: