time

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package time provides time-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(timestamp int64, layout string) string

Format formats a Unix timestamp to a string using the given layout. Uses Go's time format layout (e.g., "2006-01-02 15:04:05").

func Now

func Now() int64

Now returns the current Unix timestamp in seconds.

func Parse

func Parse(timeStr, layout string) (int64, error)

Parse parses a time string according to a layout. Returns Unix timestamp or an error.

func Sleep

func Sleep(ctx context.Context, milliseconds int64) bool

Sleep sleeps for the specified number of milliseconds. Respects the provided context for cancellation. Returns true if sleep completed, false if cancelled.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL