Date Not Getting Converted to Certain Format

I have a workflow in which I am picking information based on the current Month.

I have the Below Sheet as follows :

image

and I am getting the Required Output as I am expecting

image

Problem is in the read sheet the Date is in the Format dd-MM-yyyy but While Writing if you see it is getting pasted as MM-dd-yyyy

I have also set the format in which the date should get pasted but for some reason it isn’t getting reflected

cdate(currentRow(item.ColumnName).ToString).ToString(“dd-MM-yyyy”)

Above Statement I am using to paste the date in which I want to but some how it’s not reflecting

Any help is appreciated :slight_smile:

Hello @Ishan_Shelke ,

Here in Read range the values are being read & stored in “MM-dd-yyyy” format in your Data Table column, hence when you convert it to “dd-MM-yyyy” its coming as expected for the first 3 but for next 3 its considering Month as date and date as Month.

Try not to parse the date while writing to excel and update it AS IS.

Regards,
Rohith

Hi @Ishan_Shelke

How about this expression?

DateTime.ParseExact(CurrentRow(item.ColumnName).ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

Can you show us the excel format in the message box

Regards
Gokul

Hey!

Try this

Datetime.ParseExact(CurrentRow("ColumnName").ToString.Trim, "dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy")

Try this and let me know

Regards,
NaNi

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.