Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/bin/sh
# GetDate nDays [format]
GetDate ()
{
set -x
typeset -i nDays=$1; format=$2
typeset -i localOffset=$(echo $TZ |
sed 's![^-0-9]*\([-0-9]*\).*!\1!')
TZ=X$((localOffset-24*nDays)) date $format
}
echo "Yesterday: $(GetDate -1)"
echo "Tomorrow: $(GetDate 1)"
echo "Next week: $(GetDate 7 '+%Y-%m-%d')"
prompt>sh date.sh
+ typeset -i nDays=-1
+ format=
+ sed s![^-0-9]*\([-0-9]*\).*!\1!
+ echo EST5EDT
+ typeset -i localOffset=5
+ date
+ TZ=X29
Yesterday: Thu Jun 10 09:16:42 EDT 2004
+ typeset -i nDays=1
+ format=
+ echo EST5EDT
+ sed s![^-0-9]*\([-0-9]*\).*!\1!
+ typeset -i localOffset=5
+ date
+ TZ=X-19
Tomorrow: Thu Jun 10 09:16:42 EDT 2004
+ typeset -i nDays=7
+ format=+%Y-%m-%d
+ echo EST5EDT
+ sed s![^-0-9]*\([-0-9]*\).*!\1!
+ typeset -i localOffset=5
+ date +%Y-%m-%d
+ TZ=X-163
Next week: 2004-06-10