tweak debug, add time->str function