Skip to content

[client-v2] Convert String to DateTime #3165

Description

@chernser

Description

Original issue #3132

Define a simple and straightforward logic for converting String to Datetime. Consider next usecases

  • String contains number of seconds or milliseconds as number. However we do not know it.
  • String value is a formatted timestamp but there is no information about the format.

Activity

  1. added this to the 0.12.0 milestone on Sep 29, 2026
  2. added theissue type on Sep 29, 2026
  3. shubhamagore commented on Oct 1, 2026

    @shubhamagore

    Hey @chernser , I can pick this up and implement

    Just wanted a quick check on how flexible we want this "simple logic" to be so I don't build it wrong:

    1. Epoch Numbers: For a numeric string like "1710000000", should we assume it's always seconds or milliseconds? Or check string length (10 digits vs 13 digits) to guess?
    2. Formats: For formatted strings, do we want to stick to standard ISO-8601 out of the box, or do you have a specific list of fallback formats we should try parsing against?

    Let me know what you prefer here and I'll jump on the PR!

  4. chernser commented on Oct 1, 2026

    @chernser
    ContributorAuthor

    Good day, @shubhamagore !

    1. we should never guess about data. It creates a lot error in our and application code. Application has better knowledge about it.
    2. this is the main question. using fallback formats may cause parsing data wrongly (like with dates where month and day are on different positions). We could stick to DB default format But then others will need to convert string to proper format anyway.

    Before proceeding we need to learn more usecases - when is it needed, is it a real problem of only few care about it. Because any convenience has cost - we still have to maintain feature and if it become too bulky it will be hard to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions