September 22nd, 2003, 09:35 AM
Join Date: Sep 2003
Time spent in forums: 5 m 37 sec
Reputation Power: 0
Don't know if the TZ (Timezone variable) is set in your environment. If so something like this will do the trick (I also don't have the -v option, or similar alternative, in date).
# Name : pdate
# Purpose : Reports the date 'shift' hours from now, formatting is allowed
typeset -i X
if (( $# < 1 ))
print -u2 "Usage: $0 shift [ + format ]"
print -u2 "Reports the date 'shift' hours from now. Format as in date."
TZ=`echo $TZ | sed -e "s/MET-1/MET$((-1-X))/" -e "s/DST-2/DST$((-2-X))/"`
if [[ -z $F ]]
You might need to change $TZ to your $Timezone variable (if one excists that is).