Skip to content

Construct datetime from record #12289

@swiftvimla

Description

@swiftvimla

Related problem

I am trying to construct a datetime in a structured way and am hitting a wall.

Describe the solution you'd like

Something like

{ year: 1946 month: 12 day: 7 } | into datetime

Some components would be optional and default to zero (seconds, milliseconds)

Describe alternatives you've considered

Parsing the date from a string would solve my problem, but constructing a string when you already have the components in a structured form seems unnecessary.

I imagine the string parsing logic already does something similar after the initial tokenization stage, although I haven't looked at the source code.

I might be able to make this contribution myself if people are on board with the idea.

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:datetime-handlingSemantics and implementation of the datetime/duration types and commandscategory:enhancementNew feature or requeststatus:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions