Question

7
Replies
494
Views
Sean Bailey (SeanB897)
Nationwide Building Society

Nationwide Building Society
GB
SeanB897 Member since 2017 24 posts
Nationwide Building Society
Posted: November 6, 2018
Last activity: November 7, 2018
Posted: 6 Nov 2018 11:06 EST
Last activity: 7 Nov 2018 7:27 EST
Closed

Convert DateTime Util from US Format (MM/dd/yyy) to UK Format (dd/MM/yyyy)

All,


I wish to convert the default US Format into UK Format as part of an automation.


The automation I have is very simple see screen shot:



However I am presented with the error below:



The script I am trying to use to convert the format from MM/dd/yyyy to dd/MM/yyyy is below:

Show More

All,

I wish to convert the default US Format into UK Format as part of an automation.

The automation I have is very simple see screen shot:

However I am presented with the error below:

The script I am trying to use to convert the format from MM/dd/yyyy to dd/MM/yyyy is below:

public string Dateformat(string USdate)

{

string date = USdate; // en-US formatted date

// Convert to DateTime

DateTime parsedDate = DateTime.ParseExact(date, "MM/dd/yyyy", CultureInfo.InvariantCulture);

// Output in en-GB format

return parsedDate.ToString("dd/MM/yyyy");

}

Any help to resolve this would be much appreciated. The desired result is when I transfer Now() into an excel spreadsheet the format of the date is dd/MM/yyyy

Show Less
Robotic Process Automation
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.