Skip to content

proposal: time: add time helper UnixNano(nsec) #51148

@joshuamsager

Description

@joshuamsager

Currently, the time package allows for converting time.Time to nanoseconds. This issue proposes a symmetrical helper that converts nanoseconds to time.Time:

The proposed API follows a similar pattern to the existing helpers: UnixMilli and UnixMicro implemented in 49dccf1:

func UnixNano(nsec int64) Time {
	return Unix(nsec/1e9, nsec%1e9)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions