I have problem with export of date to my .csv file. I have this two strings:
string Time = DateTime.Now.ToString("H:mm:ss");
string Date = DateTime.Now.ToString("dd:HH:yyyy");
Time is working normal and I get to csv file right data, but Date is written to cell as "0,905324074074074". I found the problem, when creating the csv I have pName[2] = Date+";"; There is ; for shift to next cell, but it does this weird thing, i do not know why. Code for create csv:
private void SaveFileMeasure(string fileNameWithPath, string textMer, bool deleteExist)
{
try
{
try
{
if (!deleteExist)
{
File.AppendAllText(fileNameWithPath, textMer);
}
else
{
File.WriteAllText(fileNameWithPath, textMer);
}
}
catch (Exception exception)
{
MessageBox.Show("Vytvoření souboru neproběhlo v pořádku.");
}
}
finally
{
}
}
Thank for help.