FAQ
Hi all,

   I've noticed an interesting parse error in the time package (or I am
missing something important). One of the layout strings fails to parse
itself :) Which seems a bug.

   So, am I doing something wrong, or is this really a bug?

   http://play.golang.org/p/9l0vq84m6I

Cheers,
   Peter

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Fgergo at Jan 22, 2015 at 12:34 pm
    if bug, also: http://play.golang.org/p/CJ4zZTzpqR
    On Thu, Jan 22, 2015 at 11:51 AM, Péter Szilágyi wrote:
    Hi all,

    I've noticed an interesting parse error in the time package (or I am
    missing something important). One of the layout strings fails to parse
    itself :) Which seems a bug.

    So, am I doing something wrong, or is this really a bug?

    http://play.golang.org/p/9l0vq84m6I

    Cheers,
    Peter

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Nick Craig-Wood at Jan 22, 2015 at 1:01 pm
    I don't think any of those are bugs. Other than the one spotted by
    Péter Szilágyi they are all about parsing "_2" - this should be " 2" in
    the time string. "_2" means parse a 2 digit day with a space padding it
    out to two digits.
    On 22/01/15 12:34, fgergo@gmail.com wrote:
    if bug, also: http://play.golang.org/p/CJ4zZTzpqR
    On Thu, Jan 22, 2015 at 11:51 AM, Péter Szilágyi wrote:
    Hi all,

    I've noticed an interesting parse error in the time package (or I am
    missing something important). One of the layout strings fails to parse
    itself :) Which seems a bug.

    So, am I doing something wrong, or is this really a bug?

    http://play.golang.org/p/9l0vq84m6I

    Cheers,
    Peter

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Nick Craig-Wood at Jan 22, 2015 at 12:58 pm

    On 22/01/15 10:51, Péter Szilágyi wrote:
    Hi all,

    I've noticed an interesting parse error in the time package (or I am
    missing something important). One of the layout strings fails to parse
    itself :) Which seems a bug.

    So, am I doing something wrong, or is this really a bug?

    http://play.golang.org/p/9l0vq84m6I
    I don't think this is a bug.

    RFC3339 = "2006-01-02T15:04:05Z07:00"

    Note the timezone "Z07:00" - this isn't actually a valid timezone. It
    should be "Z" or "-08:00" or "+07:00". The "Z07:00" is Go's shorthand
    for that.

    See https://www.ietf.org/rfc/rfc3339.txt - 5.8. Examples

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Péter Szilágyi at Jan 23, 2015 at 7:39 am
    Ah, thanks for that :) I was interfacing countless APIs, each with its own
    different time format and I got mixed up with all the notations and
    variations.
    On Thu, Jan 22, 2015 at 2:58 PM, Nick Craig-Wood wrote:
    On 22/01/15 10:51, Péter Szilágyi wrote:
    Hi all,

    I've noticed an interesting parse error in the time package (or I am
    missing something important). One of the layout strings fails to parse
    itself :) Which seems a bug.

    So, am I doing something wrong, or is this really a bug?

    http://play.golang.org/p/9l0vq84m6I
    I don't think this is a bug.

    RFC3339 = "2006-01-02T15:04:05Z07:00"

    Note the timezone "Z07:00" - this isn't actually a valid timezone. It
    should be "Z" or "-08:00" or "+07:00". The "Z07:00" is Go's shorthand
    for that.

    See https://www.ietf.org/rfc/rfc3339.txt - 5.8. Examples

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Benjamin Measures at Jan 22, 2015 at 12:59 pm

    On Thursday, 22 January 2015 10:51:18 UTC, Péter Szilágyi wrote:
    One of the layout strings fails to parse itself :) Which seems a bug.
    Why must formatting the reference time necessarily yield the format string?

             RFC3339 = "2006-01-02T15:04:05Z07:00"

    From <http://golang.org/pkg/time/#pkg-constants>:
    Replacing the sign in the format with a Z triggers the ISO 8601 behavior
    of printing Z instead of an offset for the UTC zone.

    The format string /represents/ ISO 8601 behaviour but /is not/ an ISO 8601
    date.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 22, '15 at 10:51a
activeJan 23, '15 at 7:39a
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase