这是什么日期格式以及如何转换它?

时间:2022-10-06 16:43:23

I'm importing a csv file and one of columns is a date, but it comes with this format:

我正在导入一个csv文件,其中一列是日期,但它带有以下格式:

date;
03 FEV;
03 FEV;
05 FEV;
07 FEV;

Which format is this? How to convert it to?

这是哪种格式?如何将其转换为?

yyyy-mm-dd h:mm:ss

Thanks!

1 个解决方案

#1


1  

A date that only is "3rd Feburary" can only tell you that much. A DateTime will have to use something for the year and time, propably some default values. Keep that in mind. Also this is all asuming the Portugese Language - Brazilian Format. THe exact number formating can varry drastically, with few examples as clasical as en-US vs en-GB.

只有“3月2日”的日期只能告诉你那么多。 DateTime必须使用年份和时间的东西,可能是一些默认值。记住这一点。这也是葡萄牙语 - 巴西格式的全部。确切的数字格式可以大幅度变化,很少有像en-US和en-GB那样的例子。

//Get the culture information you will need
CultureInfo cultureFormat = CultureInfo.GetCultureInfo("pt-BR");
//Now let us try to Prase this
string input = "03 FEV";
DateTime output = DateTime.Parse(input, cultureFormat);

#1


1  

A date that only is "3rd Feburary" can only tell you that much. A DateTime will have to use something for the year and time, propably some default values. Keep that in mind. Also this is all asuming the Portugese Language - Brazilian Format. THe exact number formating can varry drastically, with few examples as clasical as en-US vs en-GB.

只有“3月2日”的日期只能告诉你那么多。 DateTime必须使用年份和时间的东西,可能是一些默认值。记住这一点。这也是葡萄牙语 - 巴西格式的全部。确切的数字格式可以大幅度变化,很少有像en-US和en-GB那样的例子。

//Get the culture information you will need
CultureInfo cultureFormat = CultureInfo.GetCultureInfo("pt-BR");
//Now let us try to Prase this
string input = "03 FEV";
DateTime output = DateTime.Parse(input, cultureFormat);