Last day variable of current month

hello, would anyone know how can i get the last day of the month, of the current month, and be able to put that date in a spreadsheet without losing the dd/MM/yyyy formatting ?

@Guilherme_Silva - Please try as shown below…

StrLastDateCurMonth = new Datetime(now.year,now.AddMonths(1).month,1).AddDays(-1).ToString("dd/MM/yyyy")

Hope this helps…

1 Like

As an alternate:
Working on June
grafik
Failling on July
grafik

Thanks to @prasath17 he fixed with:
grafik

Thanks for the catch

2 Likes

thank you so much

very good, thanks

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