Hi @Soudios - Please try this…
DateTime.parseexact(Row(“ColumnBName”).tostring,“dd/MM/yyyy hh:mm:ss”,system.globalization.cultureInfo.invariantculture).Tostring(“dd/MM/yy”)
if the above code doesn’t work…
you can try invoke code method…
My Input:
Invoke Code
dtSample.AsEnumerable().ToList().ForEach(Sub(row) row(“Date (dd/MM/yyyy)”)=DateTime.ParseExact(row(“Date (dd/MM/yyyy)”).ToString.Trim,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yy”))
Hope this helps…
dtSample is the excel file ?
I don’t understand your process my friend, can u send me a sample from the 1st step to the last step plz ?
In my excel file, i have this :
The name of my Excel file is : Excel Test
@Soudios - Please check this…Convert Date_Sou.zip (43.2 KB)
Note: The reason why the Invoke code method is used because it is very efficient when you dealing with huge data…
@Soudios - please look at my workflow closely and try to mimic all the steps.
In your invoke code…you didn’t added Dt. Click on Edit arguments and add dt in/out as datatable variable.
Also dt should be your read range output variable.
@Soudios - please show me your edit arguments in invoke code.
dt.AsEnumerable().ToList().ForEach(Sub(row) row(“Date d’entrée”)=DateTime.ParseExact(row(“Date d’entrée”).ToString.Trim,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yy”))
@Soudios - Thanks…Please click on the “Edit arguments”(Not Edit code) in the invoke code and share the screenshot…
@Soudios - hmm looks only…not sure where is the error…
This is the workflow I shared, and you can see the output on your left…
@Soudios - Now i dont see any errors in the Invoke Code activity…did it produced the output??
no output
@Soudios - Please share the screenshot of your spreadsheet??
Hi @Soudios
use this code
dt.AsEnumerable().ToList().ForEach(Sub(row) row(“Date d’entrée”)=DateTime.ParseExact(row(“Date d’entrée”).ToString.Trim,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yy”))
also after reading the excel , try using write line to display this
dt.Rows(0)(“Date d’entrée”).ToString
and check what format of date is displaying
@NIVED_NAMBIAR - Correct me if i am wrong, I didnt include HH:mm:ss because when I tested it worked fine without that. In Sou’s case, he didnt included HH:mm:ss then at least it should throw an error right??