How to check if Today's date is 3rd day of the current month

I have been trying to check if the current date is 3rd day of the month .
Previously i was looking as the current day is last date of the month and was using the below condition

DateTime.Now.ToString(“dd-MM-yyyy”) = New datetime(now.Date.Year, now.Date.Month,1).AddMonths(1).AddDays(-1).ToString(“dd-MM-yyyy”, System.Globalization.CultureInfo.CurrentCulture)

HI @mayankjha986

Try this below expression

Date.Now.AddDays(-(date.Now.Day-3)).Date.ToString("dd-MM-yyyy")=DateTime.Now.ToString("dd-MM-yyyy")

Regards
Gokul

4 Likes

not sure about your detailed requierement, but when to check of the date is the third day of the days month we can refer to the day property

grafik

1 Like

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