comparison gcc/ada/libgnat/a-calend.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- A D A . C A L E N D A R -- 5 -- A D A . C A L E N D A R --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
200 -- Ada time in UTC. 200 -- Ada time in UTC.
201 201
202 Unix_Max : constant Time_Rep := 202 Unix_Max : constant Time_Rep :=
203 Ada_Low + Time_Rep (34 * 366 + 102 * 365) * Nanos_In_Day + 203 Ada_Low + Time_Rep (34 * 366 + 102 * 365) * Nanos_In_Day +
204 Time_Rep (Leap_Seconds_Count) * Nano; 204 Time_Rep (Leap_Seconds_Count) * Nano;
205
206 Epoch_Offset : constant Time_Rep := (136 * 365 + 44 * 366) * Nanos_In_Day;
207 -- The difference between 2150-1-1 UTC and 1970-1-1 UTC expressed in
208 -- nanoseconds. Note that year 2100 is non-leap.
209 205
210 Cumulative_Days_Before_Month : 206 Cumulative_Days_Before_Month :
211 constant array (Month_Number) of Natural := 207 constant array (Month_Number) of Natural :=
212 (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334); 208 (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334);
213 209
502 begin 498 begin
503 Split (Date, Y, M, D, S); 499 Split (Date, Y, M, D, S);
504 return D; 500 return D;
505 end Day; 501 end Day;
506 502
503 ------------------
504 -- Epoch_Offset --
505 ------------------
506
507 function Epoch_Offset return Time_Rep is
508 begin
509 return (136 * 365 + 44 * 366) * Nanos_In_Day;
510 end Epoch_Offset;
511
507 ------------- 512 -------------
508 -- Is_Leap -- 513 -- Is_Leap --
509 ------------- 514 -------------
510 515
511 function Is_Leap (Year : Year_Number) return Boolean is 516 function Is_Leap (Year : Year_Number) return Boolean is