FAQ
Issue 11128 is about time.parse using atoi to parse year and timezone
offsets.

When looking into it, I found that days and months are parsed via
time.getnum, which does not support negative numbers.

It seems like years and timezone offsets should be parsed with getnum as
well.

Thoughts?
   -jeff

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

Search Discussions

  • Russ Cox at Jun 19, 2015 at 1:31 pm

    On Fri, Jun 19, 2015 at 6:21 AM, wrote:

    Issue 11128 is about time.parse using atoi to parse year and timezone
    offsets.

    When looking into it, I found that days and months are parsed via
    time.getnum, which does not support negative numbers.

    It seems like years and timezone offsets should be parsed with getnum as
    well.
    Thoughts?
    I agree that negative years are silly, but they're representable by
    time.Time. (It might still make sense to reject them, but probably not now.)

    Negative timezone offsets are common, though: half the globe has negative
    timezone offsets.

    Russ

    --
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Paul Borman at Jun 19, 2015 at 4:19 pm
    Negative years are perfectly reasonable. The world is more than 2014 years
    old and it seems reasonable to use a time.Time to represent the date of
    some artifact or event that happened in the past.
    On Fri, Jun 19, 2015 at 6:31 AM, Russ Cox wrote:
    On Fri, Jun 19, 2015 at 6:21 AM, wrote:

    Issue 11128 is about time.parse using atoi to parse year and timezone
    offsets.

    When looking into it, I found that days and months are parsed via
    time.getnum, which does not support negative numbers.

    It seems like years and timezone offsets should be parsed with getnum as
    well.
    Thoughts?
    I agree that negative years are silly, but they're representable by
    time.Time. (It might still make sense to reject them, but probably not now.)

    Negative timezone offsets are common, though: half the globe has negative
    timezone offsets.

    Russ

    --
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+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-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Russ Cox at Jun 19, 2015 at 5:07 pm

    On Fri, Jun 19, 2015 at 12:19 PM, Paul Borman wrote:

    Negative years are perfectly reasonable. The world is more than 2014
    years old and it seems reasonable to use a time.Time to represent the date
    of some artifact or event that happened in the past.
    As long as you understand that there is not widespread agreement about how
    many seconds (or even days or years) ago January 1, year -1234 was, and
    that most likely only other Go systems will agree on the meaning, sure.

    Russ

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJun 19, '15 at 10:21a
activeJun 19, '15 at 5:07p
posts4
users3
websitegolang.org

3 users in discussion

Russ Cox: 2 posts Paul Borman: 1 post Jra: 1 post

People

Translate

site design / logo © 2021 Grokbase