Extracted the date from pdf, in every pdf file format is changing. In few files its like “yyyy-MM-dd or MM-dd-yyyy or dd-MM-yyyy" but need to write the extracted date in this format yyyy-MM-dd.
str_receive = RecieveDate
RecieveDate and str_receive are of string data type
Str_date = Datetime.ParseExact(str_receive,“yyyy-MM-dd or MM-dd-yyyy or dd-MM-yyyy",System.Globalization.CultureInfo.Invariantculture).ToString(“yyyy-MM-dd”)
Assign: String was not recognized as a valid DateTime. [Error am getting]
Tried this one but not able to extract.
Please help.
@Lak_Ui
Str_date = Datetime.ParseExact(str_receive,“yyyy-MM-dd",System.Globalization.CultureInfo.Invariantculture).ToString(“yyyy-MM-dd”) or Datetime.ParseExact(str_receive,“dd-MM-yyyy",System.Globalization.CultureInfo.Invariantculture).ToString(“yyyy-MM-dd”)
In this way you are telling.
use TryParseExact instead this will give true or false value
Datetime.TryParseExact(str_receive,“yyyy-MM-dd",System.Globalization.CultureInfo.Invariantculture)
if true
use Datetime.ParseExact(str_receive,“yyyy-MM-dd",System.Globalization.CultureInfo.Invariantculture).ToString(“yyyy-MM-dd”) to convert
You can try in this way, first convert all the dates into a single format using ‘CDate’ method, then use the ‘parse extract method’ to get the required output
Hi,
I used Cdate to convert into date
str_1= CDate(D_format).Tostring(“yyyy-dd-MM”)
Str_date = Convert.ToDateTime(DateTime.ParseExact( str_1,"yyyy-dd-MM”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM-dd-yyyy”))
Like this i am getting i want to remove 00:00:00
How to do that.
Please help.
Assign: Conversion from string " 23.10.2021
" to type ‘Date’ is not valid.
What changes i need to do ,getting this error, the format should be MM-dd-yyyy.
please help.
@RK_0 ,
I am sharing sample demo file and workflow. Op.txt (95 Bytes) Sequence test.xaml (10.9 KB)
Multiple pdf’s has different formats of dates but after extraction, it has to be in this MM-dd-yyyy format.
Data is extracting properly but not able to write in given format.
Please look on it.
Datetime.ParseExact(InputDate.ToString, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy", New CultureInfo(“de-DE”))