Hello guys,
I have an input start date “01/07/2025”.
I want to get the last date of this input date.
Hello guys,
I have an input start date “01/07/2025”.
I want to get the last date of this input date.
Hi @Gokul_Murali ,
Simple way to do is Use below code:
lastDay = Date.ParseExact(“01/07/2025”,“dd/MM/yyyy”,
Globalization.CultureInfo.InvariantCulture).AddMonths(1).AddDays(-1)
Is this dd/MM/yyyy format? If so, the following may help you.
DateTime.ParseExact("01/07/2025","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture)
Regards,
Hi @Gokul_Murali ,
You can try the following,
In assign activity (convertedDate)= DateTime.ParseExact(date_, “MM/dd/yyyy”, System.Globalization.CultureInfo.InvariantCulture).. Assuming that the datetime format is in MM/dd/yyyy. If it’s in dd/MM/yyyy, then you need to update accordingly.
In another assign activity (Lastdate)= New DateTime(convertedDate.Year, convertedDate.Month, DateTime.DaysInMonth(convertedDate.Year, convertedDate.Month)).
Note: both the variables(convertedDate & Lastdate) are in DateTime datatype
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.