Skip to content

ISO 8061 negative years (BCE) #118

Closed

Description

@GoogleCodeExporter
An ISO 8061 year before the common era can be specified as negative year.  
Creating (Instant.FromUtc) with a negative year works.  And formatting with 
InstantPattern.ExtendedIsoPattern works.  

Parsing a negative year fails with InstantPattern.ExtendedIsoPattern.

What steps will reproduce the problem?

[Test]
public void Instant_IsoBceRoundtrip()
{
  var bce = Instant.FromUtc(-1194, 3, 12, 1, 2);
  var isoBce = "-1194-03-12T01:02:00Z";

  Assert.AreEqual(isoBce, InstantPattern.ExtendedIsoPattern.Format(bce));

  // The following fails!
  Assert.AreEqual(bce, InstantPattern.ExtendedIsoPattern.Parse(isoBce));
}


Original issue reported on code.google.com by makaretu on 8 Oct 2012 at 7:29

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions