diff --git a/Source/driver/Castro_io.cpp b/Source/driver/Castro_io.cpp index b002bf210e..7289d09df1 100644 --- a/Source/driver/Castro_io.cpp +++ b/Source/driver/Castro_io.cpp @@ -574,11 +574,11 @@ Castro::writeJobInfo (const std::string& dir, const Real io_time) jobInfoFile << " Plotfile Information\n"; jobInfoFile << PrettyLine; - time_t now = time(nullptr); - - // Convert now to tm struct for local timezone - tm* localtm = localtime(&now); - jobInfoFile << "output date / time: " << asctime(localtm); + const std::time_t now = time(nullptr); + char buf[64]; + if (strftime(buf, sizeof buf, "%c\n", std::localtime(&now))) { + jobInfoFile << "output date / time: " << buf << "\n"; + } char currentDir[FILENAME_MAX]; if (getcwd(currentDir, FILENAME_MAX) != nullptr) {