Hello, the top 5 cells are in General and the bottom 4 are in Date format in excel. How do I change them to date/month/year?
Hi @helpplease
Try this syntax:
DateTime.Parse(CurrentRow("column name").ToString, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None)
Hope it helps!!
What do I type for the Range? Is there an example?
Read the excel
Take for each loop
Date_Format:String
Date_Format=CurrentRow(“Date”).ToString
Assign:
Format=“d-MM-yyyy”
DateTime var=
DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture)
it didn’t work
@helpplease
Can you check with the datatype by clicking the formatcells manually in the excel. It converted
the format did not change to day-month-year
Thank you but what I want is to have a consistent format of the date as date-month-year.
The problem is that the top 5 rows are in date-month-year (28-09-2022) while the bottom 4 rows are month/date/year (9/9/2022).
@helpplease
Check with the above flow
Hi @helpplease
- Use Assign activity and use below syntax:
strinput= CurrentRow("Clock Date").ToString (Datatype: System.String)
- Use assign activity and use below syntax:
arr_input= {"dd/MM/yyyy","dd-MM-yyyy"} (DataType: Array(String))
- Use assign Acitivty:
var_DateTime= DateTime.ParseExact(str_Input1.ToString, arr_Input, System.Globalization.CultureInfo.InvariantCulture) (Datatype: System.Datetime)
- Print it wherever you want to print using below condition:
var_DateTime.ToString("dd/MM/yyyy")
Check the below workflow with sample input:
Sequence.xaml (7.4 KB)
Hope it works!!
Have you tried this. If it’s working fine at your end please matk it as solution so that it will help others in solving their query.
Happy Automation
Regards.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.