use the reentrant version of localtime if available
detect if localtime_r is available