Hello Guys,
I need to a get 2 month advance starting date and ending date.
ie, if This month is February So i need to get starting date : 01/04/2023 and ending date : 30/04/2023
If the month is march i need to get starting date : 01/05/2023 and ending date : 31/05/2023.
So please help me on this.
Gokul001
(Gokul Balaji)
February 6, 2023, 5:48am
2
HI @Gokul_Murali
Try with this expression
It will get the first date
New DateTime(Now.Year,Now.AddMonths(2).Month,1).ToString(“dd/MM/yyyy”)
It will get the last date
(New DateTime(Today.AddMonths(1).Year,Today.AddMonths(3).Month,1)).AddDays(-1).toString("MM/dd/yyyy")
Regards
Gokul
@Gokul001
I got the last date correctly.
But for starting date iam getting error like this.
Gokul001
(Gokul Balaji)
February 6, 2023, 6:11am
5
Hi @Gokul_Murali
Update the double quotation in the expression
New DateTime(Now.Year,Now.AddMonths(2).Month,1).ToString("dd/MM/yyyy")
Regards
Gokul
@Gokul001
Thank you brother for your kind help…
New DateTime(Now.Year,Now.AddMonths(2).Month,1).ToString(“dd/MM/yyyy”)
“01/04/2023”
New DateTime(Now.Year,Now.AddMonths(2).Month,Datetime.DaysInMonth(Now.Year,Now.AddMonths(2).Month)).ToString(“dd/MM/yyyy”)
“30/04/2023”
system
(system)
Closed
February 9, 2023, 7:54am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.