i am reading an excel file where i have some dates which are in dd-mm-yyyy but i want this date format in “mm/dd/yyyy”
attaching ss for ref.
expected format
i am reading an excel file where i have some dates which are in dd-mm-yyyy but i want this date format in “mm/dd/yyyy”
attaching ss for ref.
expected format
Use format cells activity and format the excel column as you need
Or include a single literal before the date in eqch row so that it pastes the smae way
Eg: '12/12/2022 00:00:00
Cheers
You can use Replace syntax. Store the particular column values in an variable say str_billDate. Use the Syntax below:
Billdate= str_BillDate.Replace(“/”,“-”)
Hope it helps!!
Regards,
do i need to install any specific package for tht because i am not getting “format cell” activity
Hi @ankur_kaushik2
You need to download UiPath.Excel.Activities to get Format Cell activity.
Regards,
Hi @ankur_kaushik2
You get Format Cell activity in Modern excel activities and not in Classic activities.
Regards,
Use the expression - DateTime.Parse(“dateinmm-dd-yyyy”).ToString(“MM/dd/yyyy”)
why in some cases while reading the date i am getting as dd-mm-yyyy but in some cases its mm/dd/yyyy?
i gave it as “12/12/2022 00:00:00” but excel converted to “12-12-2022”
okay can you please tell me why this is happening?
i am in same excel sheet and same outputdt result variable but when iterating through the date its changing every time
You missed the single quote that i placed infront of the date
12/12/2022
is wrong '12/12/2022
is correct
Cheers
@ankur_kaushik2
Can you elaborate the error that you are getting with screenshots? So that it will help
Regards
reading this issue date column
and after iterating by for each i am getting values like this
if you match these both values from excels and log message both are different.
@ankur_kaushik2
If possible share the xaml file so that I can get an solution for you with the excel file.
Regards,
DateTime.ParseExact(dateST.ToString(),“dd-MM-yyyy”,Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”) Then I converted with this; Convert.ToDateTime(formattedDate)
thanks for reply but i cant use that,personal reasons