i need to use datediff to check if my string variable(format dd-MM-yyyy) is more than 8 weeks between actual date.
How can i achieve that?
Hope this expression would help you validate whether it is more than 8 weeks between actual date
Use this expression in a IF activity
Datetime.ParseExact(strinput.ToString.Trim,”dd-MM-yyyy”, System.Globalization.CultureInfo.InvariantCulture) > DateTime.Now.AddDays(-56)
Where 56 is 8*7
We don’t have AddWeeks like AddDays
Based on true or false it goes to then or else block
(Now - DateTime.ParseExact(yourDateString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture)).TotalDays>56
String was not recognized as a valid datetime, i need first to convert my string to datetime?
May I know what is the DateTime format you have in string variable
Oh sorry I saw as /
It’s - between the date and month
This updates expression will work for sure
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.