1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . C A L E N D A R . F O R M A T T I N G --
9 -- Copyright (C) 2005 - 2006, Free Software Foundation, Inc. --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the contents of the part following the private keyword. --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
24 -- MA 02111-1307, USA. --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
36 ------------------------------------------------------------------------------
38 with Ada
.Calendar
.Time_Zones
;
40 package Ada
.Calendar
.Formatting
is
45 (Monday
, Tuesday
, Wednesday
, Thursday
, Friday
, Saturday
, Sunday
);
47 function Day_Of_Week
(Date
: Time
) return Day_Name
;
49 -- Hours:Minutes:Seconds access
51 subtype Hour_Number
is Natural range 0 .. 23;
52 subtype Minute_Number
is Natural range 0 .. 59;
53 subtype Second_Number
is Natural range 0 .. 59;
54 subtype Second_Duration
is Day_Duration
range 0.0 .. 1.0;
58 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Year_Number
;
62 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Month_Number
;
66 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Day_Number
;
70 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Hour_Number
;
74 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Minute_Number
;
77 (Date
: Time
) return Second_Number
;
80 (Date
: Time
) return Second_Duration
;
84 Minute
: Minute_Number
;
85 Second
: Second_Number
:= 0;
86 Sub_Second
: Second_Duration
:= 0.0) return Day_Duration
;
89 (Seconds
: Day_Duration
;
90 Hour
: out Hour_Number
;
91 Minute
: out Minute_Number
;
92 Second
: out Second_Number
;
93 Sub_Second
: out Second_Duration
);
97 Year
: out Year_Number
;
98 Month
: out Month_Number
;
100 Hour
: out Hour_Number
;
101 Minute
: out Minute_Number
;
102 Second
: out Second_Number
;
103 Sub_Second
: out Second_Duration
;
104 Time_Zone
: Time_Zones
.Time_Offset
:= 0);
108 Month
: Month_Number
;
111 Minute
: Minute_Number
;
112 Second
: Second_Number
;
113 Sub_Second
: Second_Duration
:= 0.0;
114 Leap_Second
: Boolean := False;
115 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Time
;
119 Month
: Month_Number
;
121 Seconds
: Day_Duration
:= 0.0;
122 Leap_Second
: Boolean := False;
123 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Time
;
127 Year
: out Year_Number
;
128 Month
: out Month_Number
;
129 Day
: out Day_Number
;
130 Hour
: out Hour_Number
;
131 Minute
: out Minute_Number
;
132 Second
: out Second_Number
;
133 Sub_Second
: out Second_Duration
;
134 Leap_Second
: out Boolean;
135 Time_Zone
: Time_Zones
.Time_Offset
:= 0);
139 Year
: out Year_Number
;
140 Month
: out Month_Number
;
141 Day
: out Day_Number
;
142 Seconds
: out Day_Duration
;
143 Leap_Second
: out Boolean;
144 Time_Zone
: Time_Zones
.Time_Offset
:= 0);
146 -- Simple image and value
150 Include_Time_Fraction
: Boolean := False;
151 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return String;
155 Time_Zone
: Time_Zones
.Time_Offset
:= 0) return Time
;
158 (Elapsed_Time
: Duration;
159 Include_Time_Fraction
: Boolean := False) return String;
161 function Value
(Elapsed_Time
: String) return Duration;
163 end Ada
.Calendar
.Formatting
;