Substratc date strings

Hi! I have variable A and B with the same format = Datetime.parseexact(row(0).ToString,“yyyyMMdd”,system.globalization.cultureinfo.invariantculture).tostring(“dd-MM-yyyy”)

How can i substract? i receive error message like “substract its not member of sting”…i try some possibilites but without sucess

another error:


@Pedro_Santos - You can try the below…


Many tanks!

But…still an error… can you help?

Hi @Pedro_Santos

Please check the two things

  1. use write line activity to check how date is outputted using row(0).ToString in writeline
    and then change format accordingly

check the preserve format in read range so to preserve the date format in excel


Tanks but… if you can help… this is the output

is it the format of row(0).ToString @Pedro_Santos


Yellow is row(0)
Blue date from a app

Both of them i use Datetime.parseexact(str yellow and blue,“dd-MM-yyyy”,system.globalization.cultureinfo.invariantculture).tostring(“dd-MM-yyyy”)

to have the same convertion and sequence.

Can i do another way?


@Pedro_Santos - Please find the attached workflow… (42.2 KB)

Hope this helps…

@Pedro_Santos - Did you get a chance to try the provided workflow?

If yes and it worked, please mark my post as solution , that will close this thread.

Check this below code, @Pedro_Santos
(Date.ParseExact(Date.ParseExact(“20211212”,“yyyyMMdd”,System.Globalization.Cultureinfo.Invariantculture).ToString(“dd-MM-yyyy”),“dd-MM-yyyy”,System.Globalization.Cultureinfo.Invariantculture) - Date.ParseExact(Date.ParseExact(“20211128”,“yyyyMMdd”,System.Globalization.Cultureinfo.Invariantculture).ToString(“dd-MM-yyyy”),“dd-MM-yyyy”,System.Globalization.Cultureinfo.Invariantculture)).TotalDays
Hope this may help you :slight_smile:

1 Like


Check below for your reference

Hope this helps you


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.