我知道这个错误:
System.FormatException:字符串不能被识别为有效的DateTime
当我偷偷摸摸谷歌加约会到印度时区。我使用以下代码:
private static DateTime Getdate(string published)
{
return DateTime.ParseExact(published, "MM/dd/yyyy", CultureInfo.InvariantCulture);
}提前谢谢。
发布于 2012-09-13 14:53:54
DateTime.ParseExact方法的第二个参数必须与第一个参数的格式匹配。尝试像这样修改代码:
private static DateTime Getdate(string published)
{
return DateTime.ParseExact(published, "yyyy-MM-ddTHH:mm:ss.fffZ", New CultureInfo("hi-IN"));
}https://stackoverflow.com/questions/12407884
复制相似问题