How to change the date format to another format

dear all,

i hava a date format in excel file like 2020/3/19 , how could i change the date format to 20200319?

anybody could give me some guide ? thanks a lot in advance.

Can you try by replacing the ‘/’ by ‘’ inside a for each row?

Or

By using Linq .

Can you try by replacing the ‘/’ by ‘’ inside a for each row? could u give me some demo?

  1. Read Excel File (With OutDT)
  2. For each row Activity (item in OutDT)
  3. Assign activity with row(“Datecolumn”) = row(“Datecolumn’).toString.replace(”/","")

You can use below code, @chrisjiyiwei
Datetime.parseexact( 2020/3/19,“yyyy/M/dd”,system.globalization.cultureinfo.invariantculture).ToString(“yyyyMMdd”)

use this way, the result is 03192020 00:00:00 how to solve it?

how to use this way? could u give me some demo?

Check this workflow, @chrisjiyiwei
Test_1.xaml (16.7 KB)

@chrisjiyiwei: You can simply use the following line of code: (Replace string with string variable)

Convert.ToDateTime(“2020/3/19”).ToString(“ddMMyyyy”)

Cheers :+1:

1 Like

Annotation 2020-03-26 153444

1 Like