call localtime when need