Skip to content

time: add Duration.Truncate #18996

@cespare

Description

@cespare

See @rsc's comment at #18991 (comment).

I was thinking of adding:

// Truncate returns the result of rounding d towards zero
// to a multiople of td.
func (d Duration) Truncate(td Duration) Duration

I'll send a CL but I want to make sure this looks good.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions