|
@@ -1976,7 +1976,16 @@ end;
|
|
Julian and Modified Julian Date conversion support
|
|
Julian and Modified Julian Date conversion support
|
|
---------------------------------------------------------------------}
|
|
---------------------------------------------------------------------}
|
|
|
|
|
|
-{$warnings off}
|
|
|
|
|
|
+{$ifopt R+}
|
|
|
|
+{$define RangeCheckWasOn}
|
|
|
|
+{$R-}
|
|
|
|
+{$endif opt R+}
|
|
|
|
+
|
|
|
|
+{$ifopt Q+}
|
|
|
|
+{$define OverflowCheckWasOn}
|
|
|
|
+{$Q-}
|
|
|
|
+{$endif opt Q+}
|
|
|
|
+
|
|
Function DateTimeToJulianDate(const AValue: TDateTime): Double;
|
|
Function DateTimeToJulianDate(const AValue: TDateTime): Double;
|
|
begin
|
|
begin
|
|
DateTimeToJulianDate := AValue - JulianEpoch;
|
|
DateTimeToJulianDate := AValue - JulianEpoch;
|
|
@@ -2015,7 +2024,16 @@ Function TryModifiedJulianDateToDateTime(const AValue: Double; var ADateTime: TD
|
|
begin
|
|
begin
|
|
NotYetImplemented('TryModifiedJulianDateToDateTime');
|
|
NotYetImplemented('TryModifiedJulianDateToDateTime');
|
|
end;
|
|
end;
|
|
-{$warnings on}
|
|
|
|
|
|
+
|
|
|
|
+{$ifdef RangeCheckWasOn}
|
|
|
|
+{$R+}
|
|
|
|
+{$undef RangeCheckWasOn}
|
|
|
|
+{$endif}
|
|
|
|
+
|
|
|
|
+{$ifdef OverflowCheckWasOn}
|
|
|
|
+{$Q+}
|
|
|
|
+{$undef OverflowCheckWasOn}
|
|
|
|
+{$endif}
|
|
|
|
|
|
{ ---------------------------------------------------------------------
|
|
{ ---------------------------------------------------------------------
|
|
Unix timestamp support.
|
|
Unix timestamp support.
|
|
@@ -2064,7 +2082,7 @@ end;
|
|
|
|
|
|
Function MacTimeStampToUnix(const AValue: Int64): Int64;
|
|
Function MacTimeStampToUnix(const AValue: Int64): Int64;
|
|
const
|
|
const
|
|
- Epoch=24107 * 24 * 3600;
|
|
|
|
|
|
+ Epoch=24107 * 24 * 3600;
|
|
begin
|
|
begin
|
|
Result:=AValue - Epoch;
|
|
Result:=AValue - Epoch;
|
|
end;
|
|
end;
|