Known child units
|
Exceptions
Time_Error renames Ada.Calendar.Time_Error |
|
Raised by To_Time if the result cannot be represented as
a value of Ada.Calendar.Time.
|
|
Type Summary
Time |
| Primitive Operations: |
"+",
"+",
"+",
"+",
"+",
"+",
"-",
"-",
"-",
"-",
"-",
"<",
"<=",
">",
">=",
Days_Between,
Julian_Day,
Now,
Secs,
Split,
Time_Of,
To_Time,
To_Time,
UTC
|
Time_Difference |
| Primitive Operations: |
"*",
"*",
"*",
"*",
"+",
"+",
"+",
"+",
"-",
"-",
"-",
"-",
"/",
"/",
"/",
"/",
"<",
"<=",
">",
">=",
From_Float,
Split,
Split,
To_Duration,
To_Float
|
|
Constants and Named Numbers
|
Other Items:
|
type Time is private;
|
|
A time type not limited to the narrow range of Ada.Calendar.Time.
Based on Chronological Julian Days, this should work for any date in
range -4712-01-01 (i.e, Jan 1st, 4713 BC) to 1465102-10-18 (i.e.,
Oct 18, 1_465_102 AD).
|
|
subtype Julian_Day_Number is Integer range 0 .. 536838867;
|
|
We just limit the range to avoid constraint errors in the calendar
packages when we try to convert a Julian_Day_Number into Day, Month,
and Year. Anyway, this should be sufficient!
|
|
subtype Day_Duration is Ada.Calendar.Day_Duration;
|
|
Conversion routines.
|
|
function To_Time
(Instant : in Ada.Calendar.Time)
return Time;
|
|
Converts an Ada.Calendar.Time to a Time value.
|
|
function To_Time
(Instant : in Time)
return Ada.Calendar.Time;
|
Converts a Time to an Ada.Calendar.Time value.
Raises Time_Error if the result cannot be represented in
Ada.Calendar.Time.
|
|
function Now
return Time;
|
|
Returns the current local time.
|
|
function UTC
return Time;
|
|
Returns the current time, expressed as Coordinated Universal Time (UTC).
Raises Time_Error if UTC is not available.
|
|
function Is_DST
return Boolean;
|
|
Returns True if Now returns "daylight savings times"; False
otherwise. Raises Time_Error if this information cannot be determined.
|
|
function Secs
(Instant : in Time)
return Day_Duration;
|
|
Returns the number of seconds (and fractions thereof) since midnight
on that day.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Days_Between
(L, R : in Time)
return Julian_Day_Number;
|
|
Disregards the time-of-day. I.e. (02-MAR-2002 00:00:01) -
(01-MAR-2002 23:59:59) = 1, even if the two instants are only two
seconds apart!
|
|
|
|
|
|
function "<"
(L, R : in Time)
return Boolean;
|
|
function "<="
(L, R : in Time)
return Boolean;
|
|
function ">"
(L, R : in Time)
return Boolean;
|
|
function ">="
(L, R : in Time)
return Boolean;
|
|
Time differences.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private
|