Tools and things that make my life easier - y'all might like them too
unixdate
Invoke date
command using Unix format on Windoze
Syntax: unixdate [date options]
See options and arguments for date
such this on this man page
$ unixdate # simplest form of the command
Tue Apr 3 08:22:23 EDT 2018
$ unixdate -u # specify -u along and Unix format will still be added
Tue Apr 3 12:22:29 UTC 2018
$ unixdate +%Y%m%d%H%M%S # specify a specific format, Unix format is avoided
20180403082255
$ /usr/bin/date # you can still get the "normal Windoze output" since you're not using the frontend at all
Tue, Apr 3, 2018 8:26:13 AM
$ alias date=unixdate # override /usr/bin/date with an alias
$ date -R # alternate way of specifiying a format
Tue, 03 Apr 2018 08:54:08 -0400
$
date
command works as you might expect.date
in a Windoze shell, you’ll run this script instead. I would encourage you add such an alias from your ~/.bashrc
but it’s up to you.
I take a fairly simple approach to seeing if a format is specified which can case the frontend. For instance, you specify -u
(UTC time) and -R
(synonymous with --rfc-2822
) without an intervening blank, the frontend isn’t aware that you want an alternate format. It tries to specify the Unix format which conflicts with --rfc-2822
and an error is raised:
$ date -uR
date: multiple output formats specified
$ date -u -R
Mon, 16 Apr 2018 19:13:20 +0000
$
Obviously, an easy to solve this is to separate the options.