fixed format_time recursion

* thread safe recursion protection