Änderung Monat

Hello, How can I change file name to the one on next month ? 30.09.2021-> 31.10.2021

@Bettina_Hornbe

Try this.

        CDate("30.09.2021").AddMonths(1).ToString("dd.MM.yyyy")

Is it possible to replace the fixed input 30.09.21 also, take current last of the month and then to last of the new month?

@Bettina_Hornbe

First find out the number of days in next month as below.

        Int DaysInMonth = System.DateTime.DaysInMonth(Now.Year, Now.Month+1)

And then calculate last day of the next month as below.

       Date LastDate = New DateTime(Now.Year,Now.Month+1,DaysInMonth)

grafik

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