timeparse

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package timeparse provides extended time and duration parsing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a simple duration string for file modification times. Supports: s (seconds), m (minutes), h (hours), d/day/days, w/week/weeks. Examples: "10h", "2d", "3weeks", "30days".

func ParseTime

func ParseTime(s string) (time.Time, error)

ParseTime parses various date/time formats in UTC. Supported formats:

  • YYYY-MM-DD (assumes 00:00:00 UTC)
  • YYYY-MM-DD HH:MM:SS (UTC)
  • RFC3339: 2018-10-27T10:00:00Z (can specify any timezone)

Returns the parsed time or an error if the format is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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