Im having the data in form of “28 Jun 2023” in string format i need to compare with current date and give result as past date or future date need help regarding the logic to convert string to date
Thanks in advance
Im having the data in form of “28 Jun 2023” in string format i need to compare with current date and give result as past date or future date need help regarding the logic to convert string to date
Thanks in advance
Use this in Assign activity
datetimevariable = DateTime.ParseExact("28 Jun 2023","dd MMM yyyy",System.Globalization.CultureInfo.InvariantCulture)
This will give you datetime type date.
Compare date with today:
datetimevariable.Date < Now.Date
- Past Date
datetimevariable.Date > Now.Date
- Future Date
Sample Code:
Output:
Workflow:
Workflow1.xaml (7.9 KB)
Thanks,
Ashok
Hi,
Can you try just CDate as the following?
So, in IF condition, it will be as the following.
CDate(yourString) > Today
Regards,
inputstr = "28 Jun 2023"
dateTime = DateTime.ParseExact(strDate, "dd MMM yyyy", System.Globalization.CultureInfo.InvariantCulture)
if
dateTime < DateTime.Now
Hope it helps!!
dateFromString = DateTime.ParseExact("28 Jun 2023", "dd MMM yyyy", System.Globalization.CultureInfo.InvariantCulture)
If:dateFromString < currentDate
There is an activity available
Just try that