I have a string as 1012022 in my excel sheet and I want to convert this into date time format.
I had tried date parsing and convert.datetime methods but they didn’t worked.
Could any one please help me on this.
Thanks in advance.
Check with the below expression below would be the Expression!
If the above not working share the Column Printing Using the write line
Can you try the following expression?
Hi @Sirimalla_Karthik_Chandra ,
TRY BELO CODE
It will work with either Date.ParseExact/DateTime.ParseExact
Hi @Jobin_Joy , thanks for replying to my query.
The String “1012022” should refer to the date 01-01-2022.
Hi @arivu96 thanks for replying. The String “1012022” should refer to the date 01-01-2022.
Hi @Yoichi, Thanks man for helping me out. Your Expression is working for me.
This technically an incorrect date format. Is there any specific reason for this format?
Because in some point of time the above format will fail.
ex: 11th Dec 2021 → (11122021)how will you indicate this date in the above format? (dMMyyyy)
single digit day is not sufficient right.
I accept your point that the date format is technically incorrect. I only get dates from 1 to 9 in single digit followed by month and year. However After 9 the dates are generated in standard format that is in “10012022”, Hence I’m not facing any issues for dates in between “10” to “31” while date parsing.
The above expression provided by @Yoichi is working fine for me.
Thank you so much @Jobin_Joy for replying to my query and helping me as much as possible.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.