Get a date in formart "dd/mm/yyyy"

Hi @Xiaoyu_Wang,

Namespace: System.Globalization

.NET Framework Class Library

CultureInfo.InvariantCulture Property

Refer this one

Regards,
Arivu

3 Likes

Hi @arivu96, there is a little mistake in your code, Argument 1 and Argument 2 need to be switched.
Best
Dieter

@ClaytonM
I tried to reverse date and month to reformat the date uisng **w(“Date”) = CDate(row(“Date”).ToString.Trim).ToString(“dd/mm/yyyy”) but it is giving month as 00
Eg :
Input -“03/22/2019”
Output -“22/00/2019”

Regards,
Shankar

2 Likes

Hi. Try using MM for month. Lowercase mm is for minutes.

Regards.

6 Likes

Hi Madhuraj,
I have a dt(variable) with format “dd.MM.yyyy”, and I want to use your method to convert it into a new format to"yyyyMMdd".
I tried with assign NewDT=Convert.ToDateTime(dt.ToString(“yyyyMMdd”)), system always come up with a complier error reminder.
Please help to take a look and help me on this.

Thanks.

Hi Sir,

What if I begin with a variable dt instead of today?
I tried both dt.ToString(“yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture) and DateTime.dt.ToString(“yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture), neither of them works.

Hey @Allen_Huang

Try to use this and lemme know.

DateTime.ParseExact("your Input Date String", "dd.MM.yyyy", CultureInfo.InvariantCulture)
                  .ToString("yyyyMMdd")

Regards…!!
Aksh

5 Likes

Dear,

Thanks for your reply, I have fixed this through other way.

Here is a detailed article on that :slight_smile:

Regards,

1 Like

Hi , I’m new to Uipath trying to fetch date from mail using item.Header(“Date”) ,the output comes in the format of Thu 02/27/2020 8:00am and I want to convert the mail date format to System date format i.e 02/27/2020

Please help.

@Samuel_Sugur1 You can use item.Header(“Date”).ToString.Substring(4,10) - this will give you 02/27/2020

Hi @TimK, I tried using this syntax but i thing this syntax is wrong.

image

what does the error say - hover over blue icon

Try .ToString at the end also.

Still shows error -Header is not the member of System.Net.mail.message

item.Headers(“Date”).ToString.Substring(4,10)

missed the s from Headers :slight_smile:
Try that

2 Likes

Hi!

I try with your metod but in the month always show “00”

CDate(CurrentRow(“Date of Birth”).ToString.Trim).ToString(“dd/mm/yyyy”)

Can you help me?

Hi @Ozkar_Nava ,
Try below code
CDate(CurrentRow(“Date of Birth”).ToString.Trim).ToString(“dd/MM/yyyy”)

Regards,
Arivu

1 Like

I need help on the attached workflow which calculates total number of days between 2 dates.
Currently it accepts input in MM/dd/yyyy format

I would like to change it to work with user input in dd/MM/yyyy format

Calculate Total Workdays.zip (2.5 KB)

Thank you very much.

I need to convert Jan into-01/01/2022 in all the excel files.How to do it?

DateTime.ParseExact(dt.ToString, “dd.MM.yyyy”, CultureInfo.InvariantCulture)
.ToString(“yyyyMMdd”)