appc/spec

actool: RFC 3339 fails on validating properly formed dates

Open

#264 opened on Mar 25, 2015

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Go (143 forks)github user discovery
help wantedkind/bug

Repository metrics

Stars
 (1,253 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Dates produced using the --rfc-3339 flag to the Linux "date" command fail validation with actool.

$ date --rfc-3339=ns
2015-03-24 18:12:14.452835861-07:00
$ ~/Downloads/appc-v0.5.0/actool build `pwd` /tmp/example.aci
build: Layout failed validation: image manifest validation failed: bad Date: parsing time "2015-03-24 18:12:14.452835861-07:00" as "2006-01-02T15:04:05Z07:00": cannot parse " 18:12:14.452835861-07:00" as "T"

This is because the use of the "T" (or it's omission) is specified as a requirement by ISO-8601 while in RFC 3339 it may be a "T" or a space (" ").

As per the RFC:

      NOTE: ISO 8601 defines date and time separated by "T".
      Applications using this syntax may choose, for the sake of
      readability, to specify a full-date and full-time separated by
      (say) a space character.

In the validation of dates we should either make a note that the use of a "T" is a requirement or fix up validation to support a space.

Contributor guide