Check if $time is an object first