函数代码
高版本中:
function LongDayNameXE(const ADateTime: TDateTime): string;
begin
Result := FormatSettings.LongDayNames[DayOfWeek(ADateTime)];
end;
function LongMonthNameXE(const ADateTime: TDateTime): string;
begin
Result := FormatSettings.LongMonthNames[DateMonth(ADateTime)]
end;
function ShortDayNameXE(const ADateTime: TDateTime): string;
begin
Result := FormatSettings.ShortDayNames[DayOfWeek(ADateTime)]
end;
function ShortMonthNameXE(const ADateTime: TDateTime): string;
begin
Result := FormatSettings.ShortMonthNames[DateMonth(ADateTime)]
end;
低版本中:
function LongDayName(const ADateTime: TDateTime): string;
begin
Result := LongDayNames[SysUtils.DayOfWeek(ADateTime)];
end;
function LongMonthName(const ADateTime: TDateTime): string;
begin
Result := LongMonthNames[DateMonth(ADateTime)]
end;
function ShortDayName(const ADateTime: TDateTime): string;
begin
Result := ShortDayNames[SysUtils.DayOfWeek(ADateTime)]
end;
function ShortMonthName(const ADateTime: TDateTime): string;
begin
Result := ShortMonthNames[DateMonth(ADateTime)]
end;