Skip to content

Consider making the meta.time field based on time.Time #14

@magnusbaeck

Description

@magnusbaeck

Description

The current data type used to represent the meta.time field is a plain integer. Someone who wants to e.g. compute the age of an event needs to apply some conversions to turn it into a time.Time value that can be used for date math (or just passing the untouched value to a function that accepts standard time.Time values).

What makes this a bit tricky is that time.Time isn't serialized as an integer but as an RFC 3339 string. The only realistic option is probably to create a new data type for which we could implement MarshalJSON and UnmarshalJSON, but then we won't be able to use the resulting meta.time values straight away anyway. Not sure what to do about this.

Motivation

Making it easier to work with the meta.time value.

Exemplification

Would simplify computation of the age of an event.

Benefits

Again, would make it easier to work with meta.time values without having to perform additional conversions.

Possible Drawbacks

None in particular.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions