CVS difference for ai12s/ai12-0336-1.txt
--- ai12s/ai12-0336-1.txt 2019/06/11 04:13:55 1.3
+++ ai12s/ai12-0336-1.txt 2019/07/03 22:01:25 1.4
@@ -1,10 +1,13 @@
-!standard 9.6.1(6/2) 19-06-06 AI12-0336-1/02
+!standard 9.6.1(6/2) 19-07-03 AI12-0336-1/03
!standard 9.6.1(35/2)
!standard 9.6.1(40/2)
+!standard 9.6.1(41/2)
!standard 9.6.1(42/3)
!standard 9.6.1(90/2)
!standard 9.6.1(91/2)
!class binding interpretation 19-06-04
+!status Amendment 1-2012 19-07-03
+!status ARG Approved 9-0-1 19-06-14
!status work item 19-06-04
!status received 19-05-30
!priority Low
@@ -13,10 +16,12 @@
!subject Meaning of Time_Offset
!summary
-UTC_Time_Offset means Calendar time - UTC time.
+Time_Offset means the time difference from UTC time.
-Time_Zone = 0 means the time zone of Calendar.
+Local_Time_Offset means Calendar time - UTC time.
+Time_Zone = 0 means the time offset of UTC.
+
!question
(1) 9.6.1(42/3) says the return value of UTC_Time_Offset is a number of
@@ -36,11 +41,13 @@
(See Summary.)
!wording
+
+Replace 9.6.1(6/2) with:
-Add after 9.6.1(6/2):
+ function Local_Time_Offset (Date : Time := Clock) return Time_Offset;
- function Local_Time_Offset (Date : Time := Clock) return Time_Offset
- renames UTC_Time_Offset;
+ function UTC_Time_Offset (Date : Time := Clock) return Time_Offset
+ renames Local_Time_Offset;
Add after 9.6.1(35/2):
@@ -53,11 +60,14 @@
Type Time_Offset represents {for a given locality at a given moment} the
number of minutes {the local time is,
at that moment, ahead (+) or behind (-) Coordinated Universal Time
-(abbreviated UTC). Redundant[ The zero value
-of type Time_Offset represents UTC}
+(abbreviated UTC). Redundant[ The Time_Offset for UTC is zero]}
[difference between UTC the implementation-defined time zone used
by Calendar and another time zone].
+Modify 9.6.1(41/2):
+
+ function {Local_Time_Offset}[UTC_Time_Offset] (Date : Time := Clock) return Time_Offset;
+
Modify 9.6.1(42/3):
Returns, as a number of minutes, {the Time_Offset of}[the result of
@@ -120,9 +130,11 @@
was that Image would do this, and we don't want to have to write too much more
to get that original intent.
-We added a renamed version of UTC_Time_Offset names Local_Time_Offset, as that
+We renames UTC_Time_Offset to Local_Time_Offset, as that
better represents the meaning of the function with the change in the definition
-of Time_Offset. Note that the actual result of the function is unchanged.
+of Time_Offset. This name is used throughout 9.6.1 Note that the actual result
+of the function is unchanged. For compatibility, a renaming of Local_Time_Offset
+named UTC_Time_Offset is also added.
We also added Local_Image, to provide the image of the Ada.Calendar time
without having to call Local_Time_Offset.
@@ -150,6 +162,90 @@
Note again that this change is inconsistent with the Ada 2012 definition.
So far as we are aware, only the beta 3.2.1 Janus/Ada follows the Ada 2012
definition, so this inconsistency is not going to arise in practice.
+
+!corrigendum 9.6.1(6/2)
+
+@drepl
+@xcode< @b<function> UTC_Time_Offset (Date : Time := Clock) @b<return> Time_Offset;>
+
+@dby
+@xcode< @b<function> Local_Time_Offset (Date : Time := Clock) @b<return> Time_Offset;>
+
+@xcode< @b<function> UTC_Time_Offset (Date : Time := Clock) @b<return> Time_Offset
+ @b<renames> Local_Time_Offset;>
+
+!corrigendum 9.6.1(35/2)
+
+@dinsa
+@xcode< @b<function> Image (Date : Time;
+ Include_Time_Fraction : Boolean := False;
+ Time_Zone : Time_Zones.Time_Offset := 0) @b<return> String;>
+@dinst
+@xcode< @b<function> Local_Image (Date : Time;
+ Include_Time_Fraction : Boolean := False;
+ Time_Zone : Time_Zones.Time_Offset := 0) @b<return> String @b<is>
+ (Image (Date, Include_Time_Fraction, Local_Time_Offset (Date)));>
+
+!corrigendum 9.6.1(40/2)
+
+@drepl
+Type Time_Offset represents the number of minutes difference between the
+implementation-defined time zone used by Calendar and another time zone.
+@dby
+Type Time_Offset represents for a given locality at a given moment the
+number of minutes the local time is,
+at that moment, ahead (+) or behind (-) Coordinated Universal Time
+(abbreviated UTC). The Time_Offset for UTC is zero.
+
+!corrigendum 9.6.1(41/2)
+
+@drepl
+@xcode<@b<function> UTC_Time_Offset (Date : Time := Clock) @b<return> Time_Offset;>
+@dby
+@xcode<@b<function> Local_Time_Offset (Date : Time := Clock) @b<return> Time_Offset;>
+
+!corrigendum 9.6.1(42/2)
+
+@drepl
+@xindent<Returns, as a number of minutes, the result of subtracting the
+implementation-defined time zone of Calendar from UTC time,
+at the time Date. If the time zone of the Calendar implementation is
+unknown, then Unknown_Zone_Error is raised.>
+@dby
+@xindent<Returns, as a number of minutes, the Time_Offset of the
+implementation-defined time zone of Calendar, at the time Date. If the
+time zone of the Calendar implementation is unknown, then Unknown_Zone_Error
+is raised.>
+
+!corrigendum 9.6.1(90/2)
+
+@drepl
+@xindent<@s9<NOTES@hr
+36 The implementation-defined time zone of package Calendar
+may, but need not, be the local time zone. UTC_Time_Offset always returns the
+difference relative to the implementation-defined time zone of package
+Calendar. If UTC_Time_Offset does not raise Unknown_Zone_Error, UTC time
+can be safely calculated (within the accuracy of the underlying time-base).>>
+@dby
+@xindent<@s9<NOTES@hr
+36 The implementation-defined time zone of package Calendar
+may, but need not, be the local time zone. Local_Time_Offset always returns the
+difference relative to the implementation-defined time zone of package
+Calendar. If Local_Time_Offset does not raise Unknown_Zone_Error, UTC time
+can be safely calculated (within the accuracy of the underlying time-base).>>
+
+!corrigendum 9.6.1(91/2)
+
+@drepl
+@xindent<@s9<37 Calling Split on the results of subtracting Duration(UTC_Time_Offset*60)
+from Clock provides the components (hours, minutes, and so on) of the UTC
+time. In the United States, for example, UTC_Time_Offset will generally be
+negative.>>
+@dby
+@xindent<@s9<37 Calling Split on the results of subtracting Duration(Local_Time_Offset*60)
+from Clock provides the components (hours, minutes, and so on) of the UTC
+time. In the United States, for example, Local_Time_Offset will generally be
+negative.>>
!ASIS
Questions? Ask the ACAA Technical Agent