Skip to content

Question about Date #19

Closed
Closed

Description

@zu1k

I'm creating a small tool that works around planet.json, I found some Date type like created make me confused.

I think Date type should follow one of RFC 2822 \ RFC 3339 \ ISO 8601, this field should be readable, could you please make a change or give some kind of parsing specification ?

Activity

  1. changed the title [-]Question ablout Date[/-] [+]Question about Date[/+] on Jun 10, 2022
  2. livid commented on Jun 10, 2022

    @livid
    Member

    Currently, it's directly from Swift JSON encoder for Swift's Date type, its raw form is a TimeInterval (=Double) of their milliseconds since the reference date: 12:00 a.m. UTC on January 1st, 2000.

  3. zu1k commented on Jun 10, 2022

    @zu1k
    Author

    Thanks for your reply.

    I am not familiar with swift, I wonder why Double, I think it should be some type of int if this means the count of milliseconds since a certain time.

    Maybe it would be more appropriate to make changes in time for the early stages of the product.

    decoder.dateDecodingStrategy = .iso8601
    encoder.dateEncodingStrategy = .iso8601
    
  4. livid commented on Jun 10, 2022

    @livid
    Member

    Thanks. But it would be a breaking change for previous versions.

  5. locked and limited conversation to collaborators on Mar 20, 2024
  6. converted this issue into a discussion #327 on Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions