I have a date that i read from excel, which i have to convert from DD/MM to MM/DD.
but i get this error:
Things I have noticed the Date in excel is dd/mm/yyyy,
but in the above screen shot, the bot has read as MM/dd/yyyy.
Any idea why?
I use assign activity
DateTime.ParseExact(String,"dd/MM/yyyy hh:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)
Am i doing anything wrong?
Anil_G
(Anil Gorthi)
November 3, 2023, 3:41am
2
@hansen_Lobo
12/16 is the input and you are giving dd/MM month cannot be 16 at all
12/16 is already in MM/dd
Please check the same
Also use HH(24 hr format) instead of hh(12 hr format)
Cheers
Thanks, i just noticed.
But Date in excel is dd/mm/yyyy,
but in the above screen shot, the bot has read as MM/dd/yyyy.
Any idea why?
Anil_G
(Anil Gorthi)
November 3, 2023, 3:49am
4
@hansen_Lobo
The excel format is just a frontend representation…everytime you need to check the actual format once you read into datatable which is the actual backend value that excel stores
Cheers
how to check which format i am getting the date in?
Anil_G
(Anil Gorthi)
November 3, 2023, 3:53am
6
@hansen_Lobo
Once you read the data into datatable using read range…open the locals panel and you can check the datatable data…
Cheers
yeah, thats one of the way, is there anyway i can know it in code, so i can put conditions if its in DD/MM or MM/DD accordingly
Anil_G
(Anil Gorthi)
November 3, 2023, 4:02am
8
@hansen_Lobo
That would work if the date is 12/16 like this but if date is below 12 then it might not be reliable…
The input date format generally does not change unless the timezones change…as excel stores the date in the current timezone format
Cheers
Thank you Anil,
Thanks for the clarifications
1 Like
Anil_G
(Anil Gorthi)
November 3, 2023, 4:16am
10
@hansen_Lobo
if its resolved please close the topic else happy to help
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
cheers
ppr
(Peter Preuss)
November 3, 2023, 8:20am
11