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
Then → Ahead
dateCompare.xaml (5.6 KB)
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
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,
Then the expression be like this
Datetime.Now.Date > Datetime.ParseExact(“2019-12-07”,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture).Date
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.