Browse Source

* currentyear (bug 4904)

git-svn-id: trunk@3031 -
marco 19 years ago
parent
commit
dd063d920d
2 changed files with 7 additions and 1 deletions
  1. 6 0
      rtl/objpas/sysutils/dati.inc
  2. 1 1
      rtl/objpas/sysutils/datih.inc

+ 6 - 0
rtl/objpas/sysutils/dati.inc

@@ -730,6 +730,12 @@ begin
 {$endif unix}
 {$endif unix}
 end;
 end;
 
 
+function CurrentYear:Word;
+var yy,mm,dd : word;
+begin
+  Decodedate(now,yy,mm,dd);
+  Result:=yy;
+end;
 
 
 Function FileDateToDateTime (Filedate : Longint) : TDateTime;
 Function FileDateToDateTime (Filedate : Longint) : TDateTime;
 
 

+ 1 - 1
rtl/objpas/sysutils/datih.inc

@@ -127,7 +127,7 @@ function TryStrToTime(const S: string; out Value: TDateTime): Boolean;
 // function TryStrToTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;
 // function TryStrToTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;
 function TryStrToDateTime(const S: string; out Value: TDateTime): Boolean;
 function TryStrToDateTime(const S: string; out Value: TDateTime): Boolean;
 // function TryStrToDateTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;
 // function TryStrToDateTime(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;
-
+function CurrentYear:Word;
 { FPC Extra }
 { FPC Extra }
 Procedure GetLocalTime(var SystemTime: TSystemTime);
 Procedure GetLocalTime(var SystemTime: TSystemTime);