Fixed date + 6 months

Hi, i got a date time there is fixed on each customers, the day is not the same, it can be different.

example: 2019-10-18 11:12:15 + 6 months.

I need this date and + 6 months

can some one help with that?

If you have it as a DateTime variable - Then just use .AddMonths(6)

I.e. MyDate.AddMonths(6)


The below line will help, I assume your date value is string type

DateTime.ParseExact(PreviousDateStr,"yyyy-MM-dd HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture)

This will return a datetime value assign it a datetime variable, then you can add 6 months with that using AddMonths(6) to the datetime variable

1 Like

Thanks! :slight_smile:

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