shfdate

package module
v0.250512.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: 0BSD Imports: 4 Imported by: 0

README

shfdate: Short Human Friendly DATE strings

This Go module is for parsing and generating strings like "060102.13" to represent the time of 2006-01-02 13:00:00. See the package documentation at https://pkg.go.dev/github.com/ypsu/shfdate for the details. This module is https://featver.iio.ie versioned.

Documentation

Overview

shfdate parses and generates Short Human Friendly DATE strings.

shfdate is YYMMDD.HHMMSS for years in 2000..2100 and YYYYMMDD.HHMMSS for everything else. In the YYMMDD case the "zero" suffixes can be omitted. 20250101, 20250101.00, 250101, 250101.00, 250101.0000, 250101.000000 all represent the same 2025-01-01 00:00:00 time. Note that the truncation only affects the time part. "25" and "2501" don't parse, it would be too hard to recognize these as dates for the humans.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s string, loc *time.Location) (time.Time, error)

Parse parses a string containing an shfdate or returns an error. Out of bound components are normalized. The time location `loc` can be nil in which case the local location is used.

func String

func String(t time.Time) string

String formats `t` into a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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