LwinMoeAUNG
(Lwin Moe AUNG)
1
Hi Guys,
I respectfully request about this solution.
I want to compare two dates,one is with String (Nov/11/2018) and the another is Integerr (11/11/2018).
I have to used this .
Convert.ToDateTime(dt.ToString(“dd/MM/yyyy”)),where dt is DateTime variable.
But I can’t use convert function .
How can I do anotherr way?
Best Regards ,
Lwin Moe Aung
2 Likes
LwinMoeAUNG
(Lwin Moe AUNG)
3
Thank you for your reply…
Sorry bro…
I means that I want to compare “Nov/11/2018” and “11/112018”.Not “Nov/11/2018” and “Nov/11/2018”.
Thanks
Lwin Moe Aung
AlexViz
4
You can use Convert.ToDateTime(your-string-date-variable) and assign it to a variable (let say monthVar).
After that you can get the month by using monthVar.Month and compare it with second-date.Month
Alternatively you could go the convoluted way and create an array of months and compare the index+1 of the array with your integer month.
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.