Different output (format) when writing to csv

excel

#1

Hi there,

I want to create a csv file with the date written as dd-mm (example 22-03). I have used the expression: Now.day.tostring+"-"+Now.Month.tostring.

When store this value in a datatable (with 20 rows of similar dates) I get differnt outputs in excel or csv.

When writing to csv i get: 22-mar (instead of 22-03). In the “add data column” I have set the “typeargument” to string.

Does anyone know how I can get the result to 22-03?

Thank you for the help.


#2

DateTime.Now.ToString(“dd-MM”)
Should work.


#3

Thanks Andrzej, works!