Skip to content

Commit d28033a

Browse files
committed
Do not replace the T delimiter with a space to respect the ISO 8601 norm
From Wikipedia: """ A single point in time can be represented by concatenating a complete date expression, the letter "T" as a delimiter, and a valid time expression. For example, "2007-04-05T14:30". Separating date and time parts with other characters such as space is not allowed in ISO 8601, but allowed in its profile RFC 3339. """ The "T" delimiter is now correctly supported by GNAT.Calendar.Time_IO.
1 parent 1b0ad29 commit d28033a

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/gnatcoll-utils.adb

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -757,21 +757,10 @@ package body GNATCOLL.Utils is
757757
end if;
758758
end loop;
759759

760-
-- In ISO format, the separator between date and time is 'T', whereas
761-
-- GNAT.Calendar.Time_IO expects as space.
762-
763760
declare
764-
S2 : String := Str (First .. Last);
765-
Local : Ada.Calendar.Time;
761+
Local : constant Ada.Calendar.Time :=
762+
GNAT.Calendar.Time_IO.Value (Str (First .. Last));
766763
begin
767-
for S in S2'Range loop
768-
if S2 (S) = 'T' then
769-
S2 (S) := ' ';
770-
exit;
771-
end if;
772-
end loop;
773-
774-
Local := GNAT.Calendar.Time_IO.Value (S2);
775764

776765
-- GNAT.Calendar.Time_IO.Value uses Ada.Calendars.Time_Of, which
777766
-- for GNAT assumes the input date is in the local time zone.

0 commit comments

Comments
 (0)