added variable accuracy to the time_format function (really should move this, huh)