timetype.sh revision 34f9b3eef6fdadbda0a846aa4d68691ac40eace5
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1982-2009 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# David Korn <dgk@research.att.com> #
# #
########################################################################
function err_exit
{
print -u2 -n "\t"
}
alias err_exit='err_exit $LINENO'
integer Errors=0
typeset -T Time_t=(
integer .=-1
_='%F+%H:%M'
get()
{
if (( _ < 0 ))
fi
}
set()
{
}
)
Time_t t=$d
t._='%#'
[[ $t == $s ]] || err_exit 'setting _ to %# not getting correct results'
unset t
unset tt
Time_t tt=('2008-08-11+00:00:00,yesterday' '2008-08-11+00:00:00,today' '2008-08-11+00:00:00,tomorrow')
unset tt
Time_t tt=([yesterday]='2008-08-11+00:00:00,yesterday' [today]='2008-08-11+00:00:00,today' [tomorrow]='2008-08-11+00:00:00,tomorrow')
unset tt
exit $Errors