Hi,
I am dealing with date returned from Abbyy manual verification station so : Case 1:
Client enter the format like 5/3/2019 10:13:43 AM format as (M/d/yyyy) and sometimes they enter like 05/03/2019 10:13:43 AM format as (MM/dd/yyyy). Case 2:
Client enter the format like 5/3/2019 10:13:43 AM format as (d/M/yyyy) and sometimes they enter like 05/03/2019 10:13:43 AM format as (dd/MM/yyyy).
I am getting this “String was not recognized as a valid DateTime” error in some cases.
So i want to deal with all this date formats that it should work with format like M/d/yyyy or MM/dd/yyyy or d/M/yyyy or dd/MM/yyyy.
I am also attaching my workflow.
Please help me on this Date_Test.zip (11.2 KB)
Aaaaaah Buddy @zeshanm9, this is really an amazing question …really, took some time to get the condition, but came out with a simple solution…here you go Datetimevalidate.zip (11.5 KB)
try with any format with input as string in the xaml
–5/3/2019 10:13:43 AM format as (M/d/yyyy)
–05/03/2019 10:13:43 AM format as (MM/dd/yyyy)
–5/3/2019 10:13:43 AM format as (d/M/yyyy)
–05/03/2019 10:13:43 AM format as (dd/MM/yyyy)
This would validate and gives you the datetime format ,here i have used messagebox to display thats why converted to string, if you want you can have that in datetime format assigned to datetime variable as well
Cheers buddy @zeshanm9
Kindly let know if this works with your scenario or not, buddy
Same buddy @zeshanm9
Datetime.Parseexact(input_time,“dd-MM-yyyyy”, system.globalization.cultureinfo.invariantculture) <= Datetime.now.Addyears(-1)
Cheers
…did that work buddy… @zeshanm9
yah thats amazing buddy @zeshanm9
If this works and got resolved kindly close this topic with right comment marked as solution that could help others looking for ideas under your topic buddy