I am dealing with date returned from Abbyy manual verification station so :
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).
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
Thank you @Palaniyappan i will try this and will let you know
I have one more question how to check if this date is less than one year or not?
Same buddy @zeshanm9
Datetime.Parseexact(input_time,“dd-MM-yyyyy”, system.globalization.cultureinfo.invariantculture) <= Datetime.now.Addyears(-1)
…did that work buddy… @zeshanm9
Yeah @Palaniyappan Great it’s working with me now as i change according to my conditions.
Please see attached workflow
Test.zip (13.2 KB)
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
Cheers buddy Keep going @zeshanm9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.