package time

import "github.com/aws/smithy-go/time"

Index

Functions

func FormatDateTime

func FormatDateTime(value time.Time) string

FormatDateTime formats value as a date-time, (RFC3339 section 5.6)

Example: 1985-04-12T23:20:50.52Z

func FormatEpochSeconds

func FormatEpochSeconds(value time.Time) float64

FormatEpochSeconds returns value as a Unix time in seconds with with decimal precision

Example: 1515531081.123

func FormatHTTPDate

func FormatHTTPDate(value time.Time) string

FormatHTTPDate formats value as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate)

Example: Tue, 29 Apr 2014 18:30:38 GMT

func ParseDateTime

func ParseDateTime(value string) (time.Time, error)

ParseDateTime parses a string as a date-time, (RFC3339 section 5.6)

Example: 1985-04-12T23:20:50.52Z

func ParseEpochSeconds

func ParseEpochSeconds(value float64) time.Time

ParseEpochSeconds returns value as a Unix time in seconds with with decimal precision

Example: 1515531081.123

func ParseHTTPDate

func ParseHTTPDate(value string) (time.Time, error)

ParseHTTPDate parses a string as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate)

Example: Tue, 29 Apr 2014 18:30:38 GMT

func SleepWithContext

func SleepWithContext(ctx context.Context, dur time.Duration) error

SleepWithContext will wait for the timer duration to expire, or until the context is canceled. Whichever happens first. If the context is canceled the Context's error will be returned.

Source Files

time.go

Version
v1.22.3 (latest)
Published
Feb 17, 2025
Platform
js/wasm
Imports
5 packages
Last checked
3 weeks ago

Tools for package owners.