Adding/subtracting time from extracted date string value from pdf

Hi guys,

I’ve succeeded in extracting dates (eg. 21 Sep 2011) from a pdf file and converting them to string form. Now, I’d like to subtract 6 months from these dates (I’ll be dumping this new value into an excel file). Does anyone know the best way to go about subtracting time from an extracted date value in string form?

Hey @Spacecats7,

Use this:

yourdatetimevariable.AddMonths(-6) it will give you a date 6 months back.

Do I have to first convert my string variable into a datetime variable?

Yes.Then only you can use the extension method add months.

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