readable-time

command module
v0.0.0-...-dfb94a5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

readable-time

Prints the current time in a slightly more readable way.

$ readable-time
ten past six, monday, august tenth

Formatting

The command takes an optional format, in the form of a template string, which can be used to customize the output.

The functions exported by time.Time can be used like this:

$ readable-time --format '{{ .Clock }}'
ten past six
$ readable-time --format '{{ .Month }} {{ .Day }}'
november first

When

The --when flag can be used to set which time is used when formatting.

It supports either a datetime given in time.RFC3999 format or a relative timestamp, e.g. "half an hour ago".

$ readable-time --format "{{ .Month }} {{ .Day }}"
november first
$ readable-time --format "{{ .Month }} {{ .Day }}" --when "a week ago"
october twenty-fifth

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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