I prefer the way the BSD date command allows returning arbitrary dates over the Linux date command. Is there a date program using BSD command line syntax and functionality for Linux?
Asked
Active
Viewed 153 times
0
-
4*arbitrary dates* - what do you mean? `man date` -> *`-d, --date=STRING` display time described by `STRING`, not `now`* – Artem S. Tashkinov Jul 10 '22 at 22:13
-
1That's exactly what I mean. Example: determine the last day of the previous month regardless of month or leap year. For Linux a way is (know a better way? Please post): date -d "$(date +%Y%m01) - 1 day". With BSD, it's date -v1d -v-1d. The BSD arguments are more obscure but straightforward. A possible key difference may be that Linux doesn't allow multiple adjustments in one invocation (requiring the "$(date +%Y%m01) above) while "man date" on Mac (a BSD date program) says "The date can be adjusted as many times as required using these flags". – Senior Geek Jul 11 '22 at 03:28