Question - DateTime Last Day and Format

Hello everyone!

Just a questions please!

How can I get the last day from a normal date, and formart it…?

Example: fecha = “08/01/23 00:00:00” how can I get the last day of January (31/01/2023), and apply it to all the months, considering February (28).

Thank you so much!!


May this help

LastDateMonth = new Date (Date.Now.Year, Date.Now.Month, System.DateTime.DaysInMonth(Date.Now.Year, Date.Now.Month))

If you don’t want use now date, replace it with your input date variable


In this case, we can use ModifyDate activity as the following.

If your input is not DateTime but string type, first parse it to DateTime type

varDateTeim = DateTime.ParseExact("08/01/23 00:00:00","dd/MM/yy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture)

Then use ModifyDate activity.