How to change date format into specific month


this

Hi @anjani_priya

Instead of dateformat give CurrentRow("column name").ToString.

Regards

here dateformat is the datatable of read range

@anjani_priya

DateTime.ParseExact(CurrentRow("Vehicle Unloaded Date").ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("MMMM")

Regards

the other values are also there in the column like blanks and NA but it should change only the dates.how to set that condition

Hi @anjani_priya

Could you share the input excel file and the conditions.

Regards

Book1.xlsx (1.4 MB)

the dates in these 2 columns should be converted into month

convert.ToDateTime(“StringDate”).ToString(“MMMM”) use this format to get only month from date
but the condition is date is in string format

Hi @anjani_priya

Input.txt (470 Bytes)

Book1 (14).xlsx (1.3 MB)

Main.xaml (11.4 KB)

Cheers!!

@anjani_priya

there are other values also in the column it should capture only date

month and year also should get

Hi @anjani_priya

Handle in IF Condition:
IF it matches the date format: returns Month Name Else: Invalid Date

Use Assign Activity for below expression:

If(DateTime.TryParseExact(dateString, “dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing),DateTime.ParseExact(dateString,“dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMMM”),“Invalid Date”)

Hope it will helps you :slight_smile:

month and year both should get

@anjani_priya
Month and Year like

Like this : April 2024 ?

yes. in this format.

you can try this
convert.ToDateTime(“StringDateVariable”).ToString(“MMMM-yyyy”) use this format to get only month from date
but the condition is date is in string format

@anjani_priya

Try this:
Forum.zip (2.1 KB)