DateTime Input to dd/MM/yyyy from "June 5, 2023 8:00 AM" format


The input in my datatable is in this format “June 5, 2023 8:00 AM”
I want to convert each date in my file to dd/MM/yy format
Keep getting errors using System.Globalization.etc

Can you help please?
Thank you


Try this

DateTime.ParseExact(str,"MMMM d,yyyy h:mm tt",system.Globalization.cultureinfo.invariantculture).ToString("MM/dd/yy")


Thank you. Getting Error BC30455: Argument not specified for parameter ‘Number’ of ‘Public Function Str(Number As Object) As String’


Str is the variable which contains your date you have to replace it with actual variable


My Assign has CurrentRow(“Start”) = above expression

When running, getting Assign Expression Activity Type ‘VisualBasicValue1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

DateTime.ParseExact(CurrentRow(“Start”).ToString,“MMMM d,yyyy h:mm tt”,system.Globalization.cultureinfo.invariantculture).ToString(“MM/dd/yy”)


Looks like you copied the inverted comma …try temoving it and replace it with inverted comma in code again and please use .ToString

Correct - "
Wrong - “


Try this one

CDate(DateTime.ParseExact(CurrentRow(“Start”).ToString,“MMMM d,yyyy h:mm tt”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yy”))

I had to convert all inverted commas and it ran. No ‘VisualBasicValue1’ error but now returns: Assign: String ‘June 5, 2023 8:00 AM’ was not recognized as a valid DateTime

MS Project exported everything as string. Will likely need to covert to date format then?

@Orchestrator_Practice did you try above both expression ?

CDate returns: Assign String ‘June 5, 2023 8:00 AM’ was not recognized as a valid DateTime

Find below help for analysing and possible corrections of a modelling:

Schedule Bot Home Construction Project v2.xlsx (11.2 KB)

MS Project Export Wizard spit out the dates in this format. Trying to standardize the dates before sending out to stakeholders. Was hoping UiPath could convert the Start / Finish Columns to dd/MM/yy format.

Changed universal Project settings to dd/MM/yy and shows up like this in Project:

but exports the data in the goofy format and gives no options for changing. No need to automate a bad process but Project is giving few options.

Resultant Excel File dates even resist format painter to convert manually

Thanks for your help and suggestions. The solution was to export in project using csv vs Excel and the format returned normally.

1 Like