Is this a bug in 'date' command version 8.28/8.30?

When I want to display the date in format YYYY-MM-DD I use the command:

date +%Y%m%d

This worked for ages without a problem. Now in Unbuntu 20.04LTS with the date command version 8.30, it gives an error:

date: multiple output formats specified

However, if I do:

sudo date +%Y%m%d

then it works fine again. Weird that you have to have root privileges to read the date. But now the strange thing:

Even if I'm root then I also need to use sudo, otherwise, I get the same error. This seems very strange to me. Is there a special reason for this? Or is this a bug?


Solution 1:

Use type date to see if date is an alias, or comes from a funny directory in $PATH.

It turned out that the user had aliased date to something suboptimal.