Result:=FormatDatetime('YYYY-MM-DD',TheDate);

解决方案 »

  1.   

    这不是delphi的事,控制面板--区域设置  短日期样式设成 yyyy-M-d 就行了
      

  2.   

    FormatDateTime('yyyy-m-d',Date)
    转换也可以
      

  3.   

    同一两位
    还有api函数
    BOOL SetSystemTime(
      CONST SYSTEMTIME *lpSystemTime  // address of system time to set
    );
     
    typedef struct _SYSTEMTIME {  // st  
        WORD wYear; 
        WORD wMonth; 
        WORD wDayOfWeek; 
        WORD wDay; 
        WORD wHour; 
        WORD wMinute; 
        WORD wSecond; 
        WORD wMilliseconds;