2
0
Эх сурвалжийг харах

* Add format method for Delphi compatibility

Michaël Van Canneyt 3 долоо хоног өмнө
parent
commit
64e57de183

+ 7 - 0
packages/rtl-objpas/src/inc/dateutil.inc

@@ -541,6 +541,7 @@ type
     property UnixTime: Int64 read GetUnixTime;
     property TotalSeconds: Int64 read GetTotalSecounds;
     function ToString(const aFormatStr: string = ''): string; inline;
+    function Format(const aFormatStr: string) : string;
     function StartOfYear: TDateTime; inline;
     function EndOfYear: TDateTime; inline;
     function StartOfMonth: TDateTime; inline;
@@ -3490,6 +3491,12 @@ begin
   Result := StartOfTheYear(Self);
 end;
 
+function TDateTimeHelper.Format(const aFormatStr: string) : string;
+
+begin
+  Result:=FormatDateTime(aFormatStr, Self);
+end;
+
 function TDateTimeHelper.ToString(const aFormatStr: string): string;
 begin
   if aFormatStr = '' then