Datetime conversion is performed in a thread-safe way.