On Wednesday, November 14, 2012 11:00:18 AM Clark WANG wrote: > In ksh: > > $ printf '%(%F %T)T\n' > 2012-11-14 10:57:26 > $ > > In bash: > > $ printf '%(%F %T)T\n' > 1970-01-01 08:00:00 > $ > > I think the ksh behavior is makes more sense so can we use the current time > as the default? > > -Clark
I agree that a null or empty argument as equivalent to -1 is a better default. "0" is identical to the current behavior for empty/unset, so no functionality is lost. Additionally, an empty format in ksh is equivalent to the date(1) default for the current locale. So, LC_TIME=C; [[ $(printf '%()T') == "$(date)" ]] is true. I imagine all the functionality ksh gets basically for free with libast tm.h functions is totally out of the question, if all there is to work from is libc strptime and friends. Having "date -d" essentially built in is handy. :/ -- Dan Douglas