date-manipulator

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: MIT Imports: 3 Imported by: 0

README

Date Manipulator

Simple application for generating RFC3339 timestamps, written in Go.

Compile the program like this:

go build 

To get the current UTC timestamp in RFC3339 format, just run the binary:

./date-manipulator
2021-06-02T20:56:32Z

To get the UTC timestamp of 15 minutes ago, specify a valid Go time.Duration string, like this:

./date-manipulator -15m
2021-06-02T20:43:38Z

To see 15 minutes ago, as well as current time, assuming Bash as your shell:

printf "Past %22s\n Now %22s\n" $(./date-manipulator -15m) $(./date-manipulator)
Past   2021-06-02T20:47:19Z
 Now   2021-06-02T21:02:19Z

Note that there are multiple time.Duration units suffixes, including "ns", "us" (or "µs"), "ms", "s", "m", and "h".

$ ./date-manipulator ; ./date-manipulator 12h
2021-06-02T21:05:45Z
2021-06-03T09:05:45Z

This is licensed under the MIT license. If you find it useful, great!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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