Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mention maximum precision of datetimes in concepts docs #1643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alkasm
Copy link

@alkasm alkasm commented Sep 23, 2024

I could not find documentation which stated the allowed precision of datetimes. The docs link to the wiki article for iso8601, but the standard doesn't state a limit to the precision:

There is no limit on the number of decimal places for the decimal fraction. However, the number of decimal places needs to be agreed to by the communicating parties. For example, in Microsoft SQL Server, the precision of a decimal fraction is 3 for a DATETIME, i.e., "yyyy-mm-ddThh:mm:ss[.mmm]".

However if you look at the conjure master test cases, an example with 9 decimal digits is in the positive test set, and one with 10 digits in the negative set:

  - type: DateTimeExample
    positive:
        - '{"value":"2017-01-02T03:04:05Z"}'
        - '{"value":"2017-01-02T03:04:05.000Z"}'
        - '{"value":"2017-01-02T03:04:05.000000Z"}'
        - '{"value":"2017-01-02T03:04:05.000000000Z"}'  # 9 digits
        - '{"value":"2017-01-02T04:04:05.000000000+01:00"}'
        - '{"value":"2017-01-02T05:04:05.000000000+02:00"}'
    negative:
        - '{"value":"4/3/2018"}'
        - '{"value":"1523040070"}'
        - '{"value":1523040070}'
        - '{"value":"2017-01-02T03:04:05.0000000000Z"}'  # 10 digits
        - '{"value":"2017-01-02T04:04:05.000000000+01:00[Europe/Berlin]"}'

@palantirtech
Copy link
Member

Thanks for your interest in palantir/conjure, @alkasm! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@alkasm alkasm changed the title Mention maximum precision of datetimes Mention maximum precision of datetimes in concepts docs Sep 23, 2024
@alkasm alkasm changed the title Mention maximum precision of datetimes in concepts docs docs: mention maximum precision of datetimes in concepts docs Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants