Browse Source

* Fix bug ID #27751 (Fill SystemTime.DayOfWeek)

git-svn-id: trunk@30384 -
michael 10 năm trước cách đây
mục cha
commit
9ae76c3246
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 2 1
      rtl/objpas/sysutils/dati.inc
  2. 1 1
      rtl/objpas/sysutils/datih.inc

+ 2 - 1
rtl/objpas/sysutils/dati.inc

@@ -216,8 +216,9 @@ end;
 
 procedure DateTimeToSystemTime(DateTime: TDateTime; out SystemTime: TSystemTime);
 begin
-  DecodeDate(DateTime, SystemTime.Year, SystemTime.Month, SystemTime.Day);
+  DecodeDateFully(DateTime, SystemTime.Year, SystemTime.Month, SystemTime.Day,SystemTime.DayOfWeek);
   DecodeTime(DateTime, SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.MilliSecond);
+  Dec(SystemTime.DayOfWeek);
 end ;
 
 {   SystemTimeToDateTime converts SystemTime to a TDateTime value   }

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

@@ -93,7 +93,7 @@ type
 {$if not(defined(windows)) and not(defined(win32))}
    { Win32 reuses the struct from the Windows unit }
    TSystemTime = record
-      Year, Month, Day: word;
+      Year, Month, Day, DayOfWeek: word;
       Hour, Minute, Second, MilliSecond: word;
    end ;
 {$endif windows}