The spec file explains that the picture "%c" stands for
locale's date and time (including the time zone).
However, the replacement picture doesn't include %z (which
isn't supported AFAICS.)

from the spec:
--          %c   locale's date and time (Sat Nov 04 12:02:33 EST 1989)

from the body:
              when 'c' =>
                  case Padding is
                     when Zero =>
                        Result := Result & Image (Date, "%a %b %d %T %Y");


$ ./testtime 
Wed Jun 13 17:17:41 2007

(This has lead to a time shift when some application, such as a MTA,
interprets the time WRT a different default time zone, such as UTC.)

with GNAT.Calendar.Time_IO;
with Ada.Calendar;
with Ada.Text_IO;

procedure testtime is
begin
   Ada.Text_IO.Put_Line
      (GNAT.Calendar.Time_IO.Image (Ada.Calendar.Clock, "%c"));
end;

The code is present in trunk, Rev 125413


-- 
           Summary: GNAT.Calendar.Time_IO "%c" incorrectly claims to be
                    reporting the time zone
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bauhaus at futureapps dot de
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32318

Reply via email to