Menu

Diff of /trunk/Src/UUpdateCheckers.pas [r2888] .. [r2889]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/Src/UUpdateCheckers.pas
+++ b/trunk/Src/UUpdateCheckers.pas
@@ -149,8 +149,6 @@
     ///  <exceptions>If S is not a valid config file date a fatal exception will
     ///  be raised.</exceptions>
     function ParseDate(const S: string): TDateTime;
-    ///  <summary>Returns the current date and time as GMT/UTC.</summary>
-    function NowAsGMT: TDateTime;
   public
     ///  <summary>Construct new object instance and reads last update check
     ///  times from storage.</summary>
@@ -175,7 +173,7 @@
   Classes, Windows, DateUtils,
   // Project
   FmUpdateDlg, UAppInfo, UPreferences, UProgramUpdateChecker, USettings,
-  UStrUtils, UUpdateMgr;
+  UStrUtils, UUpdateMgr, UUtils;
 
 
 { TProgramUpdateCheckerThread }
@@ -326,7 +324,7 @@
 
 function TUpdateCheckerConfig.CanCheck(Kind: TCheckKind): Boolean;
 begin
-  Result := DaysBetween(NowAsGMT, fLastUpdateCheck[Kind]) > 0;
+  Result := DaysBetween(NowGMT, fLastUpdateCheck[Kind]) > 0;
 end;
 
 constructor TUpdateCheckerConfig.Create;
@@ -363,14 +361,6 @@
 begin
   // In config file we store date in SQL date format
   Result := FormatDateTime('yyyy"-"mm"-"dd" "hh":"nn":"ss', DT);
-end;
-
-function TUpdateCheckerConfig.NowAsGMT: TDateTime;
-var
-  ST: TSystemTime;
-begin
-  GetSystemTime(ST);
-  Result := SystemTimeToDateTime(ST);
 end;
 
 function TUpdateCheckerConfig.ParseDate(const S: string): TDateTime;
@@ -391,7 +381,7 @@
 
 procedure TUpdateCheckerConfig.RecordCheck(Kind: TCheckKind);
 begin
-  fLastUpdateCheck[Kind] := NowAsGMT;
+  fLastUpdateCheck[Kind] := NowGMT;
 end;
 
 function TUpdateCheckerConfig.ValueName(const Kind: TCheckKind): string;
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.