CSV file date format

Copper Contributor

Hello! We have a problem with a csv file. We have a column which needs the formatting tt.mm.jjjj hh:mm Currently it is tt.mm.jj hh:mm (the year only has two digits instead of four). If we change it in the custom format setting and save the document, close it and open it again the formatting is the same as it was before, so again only with two digits instead of four. This is only the case for csv files, for xlsx files the custom formatting stays the same even after closing and opening it again, but we need the document in a csv format.

 

It would be great if someone could help me with that!

4 Replies

@ChristinaHeinloth 

CSV files can't store format information.

Thank you for that hint. Do you know any other solution how to solve this problem?
An option might be to stop opening csv files with Excel and, instead, import the csv file to Excel using Power Query.

@ChristinaHeinloth 

Yes, CSV is actually text file. However, if open CSV in Excel, apply custom format to data, save file as CSV it shall save the data (as text) in the form of applied format. Another story is that if you open file again in Excel it could show you some data in your default locale format, but that's only visualization. You may check in Notepad that is the actual data.

So, depends on goals - to change the data or to show the data. If former it works. If latest it depends, when Excel format is most reliable.

See for example Formatting Dates for CSV Imports – Administration (echo360.com)