Hi
I have a date in the form of String example str=2019-12-07
I need to check whether current date is ahead of given date
Hi
use a IF condition like this
Datetime.Now > Datetime.ParseExact(“2019-12-07”,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture)
if true it will go to THEN part or goes to ELSE part
Cheers @KarthikBallary
Hi
but if given date is equal to current date it is showing current date is ahead of given date
It think current date is considering time also. How to ignore time?
try like this,
cdate(strDate).Date>now.Date
Thanks!
Then the expression be like this
Datetime.Now.Date > Datetime.ParseExact(“2019-12-07”,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture).Date
Cheers @KarthikBallary
I have used if cdate(strDate)<cdate(now.toString(“yyyy-MM-dd”) and its working fine
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.