-- prefixed with a minus sign. If abs Elapsed_Time represents 100 hours or
-- more, Time_Error is raised.
+ function Local_Image
+ (Date : Time;
+ Include_Time_Fraction : Boolean := False) return String
+ is (Image (Date,
+ Include_Time_Fraction,
+ Time_Zones.Local_Time_Offset (Date)));
+ -- Returns a string form of Date relative to the local time offset.
+
function Value (Elapsed_Time : String) return Duration;
-- Returns a Duration value for the image given as Elapsed_Time.
-- Constraint_Error is raised if the string is not formatted as described
-- All operations in this package are target and time representation
-- independent, thus only one source file is needed for multiple targets.
- ---------------------
- -- UTC_Time_Offset --
- ---------------------
+ -----------------------
+ -- Local_Time_Offset --
+ -----------------------
- function UTC_Time_Offset (Date : Time := Clock) return Time_Offset is
+ function Local_Time_Offset (Date : Time := Clock) return Time_Offset is
Offset_L : constant Long_Integer :=
Time_Zones_Operations.UTC_Time_Offset (Date);
Offset : Time_Offset;
end if;
return Offset;
- end UTC_Time_Offset;
+ end Local_Time_Offset;
end Ada.Calendar.Time_Zones;
-- This package provides routines to determine the offset of dates to GMT.
-- It is defined in the Ada 2005 RM (9.6.1).
-package Ada.Calendar.Time_Zones is
+package Ada.Calendar.Time_Zones
+-- with Nonblocking
+is
-- Time zone manipulation
Unknown_Zone_Error : exception;
- function UTC_Time_Offset (Date : Time := Clock) return Time_Offset;
+ function Local_Time_Offset (Date : Time := Clock) return Time_Offset;
+ function UTC_Time_Offset (Date : Time := Clock) return Time_Offset
+ renames Local_Time_Offset;
-- Returns (in minutes), the difference between the implementation-defined
-- time zone of Calendar, and UTC time, at the time Date. If the time zone
-- of the Calendar implementation is unknown, raises Unknown_Zone_Error.