I would like to use the date command on a Mac to find out the day corresponding to a certain date.
On Debian the command below works:
date --date "Jul 20 1999" +%A
But the same command does not work when I use Mac's terminal.
What can be an alternative to achieve the output of the above command on a Mac?
This works:
date -j -vJulm -v20d -v1999y '+%A'
According to the OSX date manual page::
-v
Adjust (i.e., take the current date and display the result of the adjustment; not actually set the date) the second, minute, hour, month day, week day, month or year according to val. If val is preceded with a plus or minus sign, the date is adjusted forwards or backwards according to the remaining string, otherwise the relevant part of the date is set. The date can be adjusted as many times as required using these flags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With