Format date field using Generate Data Table activity

I am trying to return data from csv file (csvText variable) to DataTable, then to put data from table to excel file:

image

Is there a way to format date column to “dd.MM.yyyy” format before inserting to excel?

Note: Inside csv file it is already in “dd.MM.yyyy” format, but sometimes it changes after inserting to excel.

Hi @Olivera_Kalinic

Check this alternative works for you

After writing in the excel file use Change cell type activity and try to format your cell

Regards
Sudharsan

1 Like

Hi @Olivera_Kalinic

Have a look on the thread

Regards
Gokul

Datetimes don’t have formats. They store dates/times in milliseconds since 1970.

You format them when you output them as a string to see the value, type the value, etc.

@Olivera_Kalinic Check the below one

it could be the case that Excel will different approach the values and trigger an unwanted cell formatting.

  • As mentioned by @Sudharsan_Ka we can post format with the help of Balareva Change Cell Type

  • With the newer activities we do also have the option of
    Format Cells

  • The quick and dirty trick by leading apostrophe before the value forcing Excel to handle it as text

As also mentioned above we retrieve different outputs / formated strings from a datetime, but never will touch its internal structure. But as mentioned the data is already in a form you would like to store.

However we should not mismatch DateTime
grafik

And a Unix Timestamp
grafik

1 Like