neetha
(Neetha)
1
Hi,
If activity: condition => DateTime.TryParseExact(PreviousDateStr,“MM/dd/yyyy hh:mm:ss”, Globalization.CultureInfo.InvariantCulture, Globalization.DateTimeStyles.None, Nothing)
True: Assign activity: PreviousDateString = DateTime.ParseExact(PreviousDateStr,“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
False: Message Box Activity: Text => “Date is in wrong format”
when i execute above workflow it’s giving false
any help will be appreciated.
Thanks
Neetha
sarathi125
(Parthasarathi)
2
what value you are passing in this variable
neetha
(Neetha)
3
Convert.ToString(now.AddDays(-7))
Hi Neetha,
Use this:
DateTime.ParseExact(PreviousDateStr,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture)
1 Like
sarathi125
(Parthasarathi)
5
@neetha,
The below line of code will resolve your issue, check and let me know.
DateTime.TryParseExact(Convert.ToString(Now.AddDays(-7).ToString("MM/dd/yyyy hh:mm:ss")), "MM/dd/yyyy hh:mm:ss", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing)
4 Likes
neetha
(Neetha)
6
Thanks @sarathi125 and @Rahul_Pasupuleti both for immediate response,
Below is the solution
now when i execute workflow it’s giving True
If activity: condition => DateTime.TryParseExact(PreviousDateStr, “MM/dd/yyyy HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing)
True: Assign activity: PreviousDateString = DateTime.ParseExact(PreviousDateStr,“dd/MM/yyyy HH:mm:ss”,CultureInfo.InvariantCulture)
False: Message Box Activity: Text => “Date is in wrong format”
Thanks
Neetha
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.