Re: Output from date command defaults to 12-hour in Buster.
On Wed, Apr 29, 2020 at 08:56:24AM -0500, Martin McCormick wrote:
> Greg Wooledge <wooledg@eeg.ccf.org> writes:
> > On Tue, Apr 28, 2020 at 10:53:25PM -0600, Charles Curley wrote:
> > > Adding
> > >
> > > alias date='date +"%a %b %d %T %Z %Y"'
> > >
> > > to one's .bashrc or /etc/bashrc should get the OP what he wants.
>
> It did make just the date command work as desired. I
> actually tried that very thing maybe a year or so ago
> and it worked, sort of.
It breaks if you try to use your own "plus" argument.
unicorn:~$ alias date='date +"%a %b %d %T %Z %Y"'
unicorn:~$ date +%s
date: extra operand ‘+%s’
Try 'date --help' for more information.
unicorn:~$ unalias date
unicorn:~$ date +%s
1588170499
If you mean "It worked when I ran date with no arguments", then sure,
it will "work" for that one sample case. But it breaks in many other
cases.
Reply to: