As you can see from the image, the data on row 40688 is correct (greek format) and the data on row 40689 don’t have the correct format.
For instance, the cell M 40689 need to change from “3/17/2021 8:51:00 PM” to “17/3/2021 8:51:00 μ.μ.”.
Hello @Hiba_B
Thank you for your reply.
When I try to assign the date_time to date_datatime using “None” (date_time = DateTime.ParseExact(date_string, “dd/MM/yyyy HH:mm:ss tt”, None)), there is error.
So, I changed “None” to “System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat”.
But still there is error: when date_string has the value “03/22/2021 12:17:00” and I tried the above, the error was: “String was not recognized as a valid DateTime.”
Any ideas?
Alright, then you can remove the 3rd argument (it’s optional).
The problem is that the value 03/22/2021 12:17:00 doesn’t have μ nor PM/AM. So for the form dd/MM/yyyy HH:mm:ss tt the robot does not recognize the tt (which is supposed to be AM or PM).
Ok so the solution might me to use the try catch activity:
in the try, drag&drop date_time = DateTime.ParseExact(date_string, “dd/MM/yyyy HH:mm:ss tt”)
in the catch, add a new catch with the exception System.Exception. Inside, put an assign activity with date_time = DateTime.ParseExact(date_string, “dd/MM/yyyy HH:mm:ss")
Give it a try and let us know ! Especially if there are other date forms expected in the column
The information exists, but it doesn’t appear properly. There are no other date formats. I’ll try what you suggest. @NIVED_NAMBIAR I’ll check it and I’ll tell you.
@Hiba_B The format “dd/MM/yyyy hh:mm” is alright in the cell, but it doesn’t display the “ss tt” at the end, although it exists (above, in the function line of excel).
@Hiba_B@NIVED_NAMBIAR
I’m quite close.
I assigned date_String=Datetime.ParseExact(row(“ASSIGNMENTFINISH”).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.CreateSpecificCulture(“el-GR”)).ToString(“dd/MM/yyyy HH:mm:ss tt”)
Although I use CreateSpecificCulture(“el-GR”) (with “ell-el” there was error), date_String has the value of “16/03/2021 09:35:00 AM” and not “16/03/2021 09:35:00 π.μ.” as I would like.
Any ideas?
Very nice @Hiba_B!
The result is very good: “17/03/2021 12:20:00 μμ”.
The only thing is that the dots are missing, e.g. “17/03/2021 12:20:00 μ.μ.”.
I tried with dots in “t.t.”, and although the “μ.μ.” is ok, the “πμ” becomes “π.π.”.
I have no clue why.
Oh it’s alright, in the second system.globalization you have to add the point:
date_String=Datetime.ParseExact(row(“ASSIGNMENTFINISH”).ToString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.CreateSpecificCulture(“el-GR”)).ToString(“dd/MM/yyyy HH:mm:ss t.t”,System.Globalization.CultureInfo.CreateSpecificCulture(“el-GR”))
Ah sorry I just read completely what you wrote; I am thinking into a way
@Hiba_B, yes that’s true. If I leave it “tt” then only apears “πμ” or “μμ”.
But in this case the dots are missing. I also tried “t.t” (with only 1 dot, so I could add the last dot afterwards), but still “πμ” becomes “π.π”, which is wrong.