即时使用以下linq查询来比较某些日期,它的工作,但当我将系统文化更改为en-US(我在法国文化)它显示我错误 字符串未被识别为WHERE部分的有效日期时间,这是我的查询:字符串未被识别为where语句中的有效日期时间
var query =
from Ovp c in lOvpReponse.result
where (DateTime.parse(c.dateEcheance) >= DateTime.Now.AddDays(-90))
select new
{
RefDossier = c.refDossier,
CompteEmetteur = c.compteEmetteur,
NomBeneficiaire = c.nomBeneficiaire,
Montant = c.montant,
Periodicite = c.periodicite,
status = DateTime.Parse(c.dateEcheance)>= DateTime.Now ? "Expiré" : "Activé",
};
希望能在这里得到一些快速的帮助。
什么是'c.dateEcheance'价值?您的机器上当前的日期时间设置是什么? –
[DateTime.Parse](https://msdn.microsoft.com/en-us/library/kc8s65zs(v = vs.110).aspx)。 – Sinatr
@PatrickHofman @PatrickHofman我目前的datime设置是法国的每件事都可以,但是当我将该项目移动到另一台在en-US上运行的计算机时,给了我这个错误并且日期值格式为30/04/2034 –