I’m just starting off in UiPath and wondered if anyone could help me solve this.
I am looking to take a date from excel and input into a desktop application using UiPath. I have formatted the cell in Excel to be “mm/dd/yyyy”, but when the date is transferred it comes in as “mm/dd/yyyy 00:00:00”.
Is there a way to remove this time stamp using UiPath?
I’m currently using the function Type Into and “Effective” in my date variable.
the full timestamp is good. You can just format it to how you want using date functions like Year(date) or Month(date) or the preferred way you can use .ToString(format), like datetime.ToString(“MM/dd/yyyy”)
So you can get rid of the time by using different format methods.
If your variable is of String type, try to assign your variable to something like this: DateTime.ParseExact(Effective, "MM/dd/yyyy", CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")
Looks like you need to store Effective to something before performing that assign. If you are wanting to store it after the assign then you would need to use an If condition to get around the error.
For example:
Assign Effective = If(Effective=Nothing,Nothing,DateTime.ParseExact(Effective, “MM/dd/yyyy 00:00:00”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”))