Date
Display date and operate date.
Usage
$ show date -h
NAME:
show date - show date
USAGE:
show date command [command options] [arguments...]
COMMANDS:
now show current date
add add timestamp to current date
convert date conversion
time show current time
help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
now
$ show date now -h
NAME:
show date now - show current date
USAGE:
show date now [command options] [arguments...]
DESCRIPTION:
eg: show date now -f "2006-01-02"
show date now --timestamp
show date now --before "2011-11-11 08:10:10"
show date now --after "2011-11-11 08:10:10"
OPTIONS:
--format value, -f value format date, it has no effect on --timestamp | --before | --after
--timestamp, -t show timestamp, unit: ms, it has no effect on --before | --after, (default: false)
--before value, -b value compare whether the date is before the specified date, this flag and --after are mutually exclusive
--after value, -a value compare whether the date is after the specified date, this flag and --before are mutually exclusive
--help, -h show help (default: false)
add
$ show date add -h
NAME:
show date add - add timestamp to current date
USAGE:
show date add [command options] [arguments...]
DESCRIPTION:
add timestamp to current date by --millisecond | --second,
if neither of this not set, the default is current date
eg: show date add --millisecond 5000
show date add --second 5
show date add --second 5 --format "2006-01-02 15:04:05"
show date add --second 5 --timestamp
show date add --second 5 --before "2021-11-11 10:00:00"
show date add --second 5 --after "2021-11-11 10:00:00"
OPTIONS:
--millisecond value, -m value add millisecond to current date (default: 0)
--second value, -s value add second to current date (default: 0)
--format value, -f value format date, it has no effect on --timestamp | --before | --after
--timestamp, -t show timestamp, unit: ms, it has no effect on --before | --after, (default: false)
--before value, -b value compare whether the date is before the specified date, this flag and --after are mutually exclusive
--after value, -a value compare whether the date is after the specified date, this flag and --before are mutually exclusive
--help, -h show help (default: false)
convert
$ show date convert -h
NAME:
show date convert - date conversion
USAGE:
show date convert command [command options] [arguments...]
COMMANDS:
timestamp convert the specified date string into a timestamp, unit: ms
date convert the specified timestamp (unit: ms) into a date (the output layout: "2006-01-01 15:04:05") string
help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
time
$ show date time -h
NAME:
show date time - show current time
USAGE:
show date time [command options] [arguments...]
DESCRIPTION:
the flag --second and --millisecond are mutually exclusive, if both are specified, only --second is affected
eg: show date time
show date time --second
show date time --millisecond
show date time --clock 12h
OPTIONS:
--clock value, -c value show clock layout, 24h | 12h can be specified (default: 24h)
--second, -s show current time as seconds (default: false)
--millisecond, -m show current time as milliseconds (default: false)
--help, -h show help (default: false)