我的程序在2000下没有问题可是到了XP下面就报:时间非法错误,2003-9-16 是一个非法时间数据,应怎么解决啊,我用来额strtodatetime函数

解决方案 »

  1.   

    你可以在你的程序中用代码给机子设置统一时间格式,如:
    SetLocaleInfo(LOCALE_SLONGDATE, LOCALE_SDATE, '-');设置为'YYYY-MM-DD'格式。————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————
      

  2.   

    用formatdate() FUNTION 将时间格式为“yyyy-dd-mm”试一试!
      

  3.   

    将strtodatetime改为VarToDateTimeonverts a specified variant to a TDateTime value.UnitVariantsCategoryVariant support routinesDelphi syntax:function VarToDateTime(const V: Variant): TDateTime);C++ syntax:extern PACKAGE TDateTime __fastcall VarToDateTime(const Variant &V);DescriptionVarToDateTime converts the given variant to a TDateTime value. VarToDateTime raises an exception if the conversion fails.