靠来晚了 ~~ 贴个DELPHI帮助 UnitSysUtilsCategorydatetime routinesDelphi syntax:function FormatDateTime(const Format: string; DateTime: TDateTime): string; overload; function FormatDateTime(const Format: string; DateTime: TDateTime; const FormatSettings: TFormatSettings): string; overload;C++ syntax:extern PACKAGE AnsiString __fastcall FormatDateTime(const AnsiString Format, System:: TDateTime DateTime); extern PACKAGE AnsiString __fastcall FormatDateTime(const AnsiString Format, System:: TDateTime DateTime, const TFormatSettings FormatSettings);DescriptionFormatDateTime formats the TDateTime value given by DateTime using the format given by Format. See Date-Time format strings for more information.If the string specified by the Format parameter is empty, the TDateTime value is formatted as if a 'c' format specifier had been given.The first form of FormatDateTime is not thread-safe, because it uses localization information contained in global variables. The second form of FormatDateTime, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of FormatDateTime, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings. 厚着脸接分
begin
Edit1.Text:=FormatDateTime('yyyymmdd',date);
end;
FormatDateTime('yyyymmdd',date);
'yyyymmdd':=copy('yyyy.mm.dd',1,4)+copy('yyyy.mm.dd',6,2)+copy('yyyy.mm.dd',9,2)
没话说!!
贴个DELPHI帮助
UnitSysUtilsCategorydatetime routinesDelphi syntax:function FormatDateTime(const Format: string; DateTime: TDateTime): string; overload;
function FormatDateTime(const Format: string; DateTime: TDateTime; const FormatSettings: TFormatSettings): string; overload;C++ syntax:extern PACKAGE AnsiString __fastcall FormatDateTime(const AnsiString Format, System::
TDateTime DateTime);
extern PACKAGE AnsiString __fastcall FormatDateTime(const AnsiString Format, System::
TDateTime DateTime, const TFormatSettings FormatSettings);DescriptionFormatDateTime formats the TDateTime value given by DateTime using the format given by Format. See Date-Time format strings for more information.If the string specified by the Format parameter is empty, the TDateTime value is formatted as if a 'c' format specifier had been given.The first form of FormatDateTime is not thread-safe, because it uses localization information contained in global variables. The second form of FormatDateTime, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of FormatDateTime, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings.
厚着脸接分