How can i change date format from data table

Need to change this format : dd.MM.yyyy to yy/MM/dd

AssignDate = ExtractDataTable.rows(0)(“Date”).toString

Give AssignDate= ExtractDataTable.rows(0)(“Date”).ToString(“yy/MM/dd”) a shot:

Hope that helps!

1 Like

Hi!

ExtractDataTable.rows(0)(“Date”).toString(“yy/MM/dd”)

Regards,
NaNi

1 Like

Hi @Soudios

For each row in Extract Datatable

Assign
LHS
CurrentRow(“date”)

RHS
Cdate(CurrentRow(“date”).toString).toString(“yy/MM/dd”)

or

DateTime.ParseExact(CurrentRow(“date”).ToString,"dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture).toString(“yy/MM/dd”)

Out side the body of loop

Use ExtractDatatable with the date format changed!

Regards

2 Likes

@pravin_calvin

It doesnt work for me, i have an error :


Hi @Soudios

I think you have missed the loop !

Use for each row in datatable

And then assign the

CurrentRow(“Date Piece”) = DateTime.ParseExact(row("Date Piece ").ToString,dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture).toString(“yy/MM/dd”)

Regards

2 Likes

@pravin_calvin

Thank you its working

1 Like

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