Date subtract from a particular date

Hi All,

Can anybody suggest me, how we can subtract the date from a date we getting from mail header(Mail received Date)?

Eg.
Date of received mail: 02/16/2019
and the required date is 3 days before this date?

Convert the string to dateTime object
yourDate = DateTime.ParseExact(yourdateString,"MM/DD/YYYY")
finalDate = yourDate.AddDays(-3)

Regards,
Karthik Byggari

Hi @ShekharRPA

Use an assign activity and pass the type as datetime

and Dt received-Now.AddDays(-3).ToString(“MM/dd/yyyy”)

Thanks
Ashwin S

Hi
Like this
Datetime.ParseExact(item.Headers(“Date”).ToString.Substring(0,10),”MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).AddDays(-3)

Where item is the variable inside the FOR EACH a loop having the list of mailmessage variable as input

Cheers @ShekharRPA

Can share an sampleXaml

Can share an sample Xaml

Can share an sample Xaml

@ShekharRPA

      Assign str =  "02/16/2019"
      Assign str = CDate(Str).AddDays(-3).ToString("MM/dd/yyyy")

Now str will have 02/13/2019

image

Sure like this
BlankProcess10.zip (9.5 KB)

Cheers @ShekharRPA