Skip to content

j-sv/readable-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published