35 lines
612 B
Bash
Executable File
35 lines
612 B
Bash
Executable File
#!/usr/bin/env zsh
|
|
|
|
#set -x
|
|
case "$(basename ${0})" in
|
|
today)
|
|
date +%F | tr -d '\n'
|
|
;;
|
|
yesterday)
|
|
date -d '-1 day' +%F | tr -d '\n'
|
|
;;
|
|
tomorrow)
|
|
date -d '+1 day' +%F | tr -d '\n'
|
|
;;
|
|
nextweek)
|
|
date -d '+1 week' +%F | tr -d '\n'
|
|
;;
|
|
lastweek)
|
|
date -d '-1 week' +%F | tr -d '\n'
|
|
;;
|
|
nextyear)
|
|
date -d '+1 year' +%F | tr -d '\n'
|
|
;;
|
|
lastyear)
|
|
date -d '-1 year' +%F | tr -d '\n'
|
|
;;
|
|
now)
|
|
date +'%FT%T %:z'
|
|
;;
|
|
*)
|
|
date
|
|
;;
|
|
esac
|
|
#set +x
|
|
|