From c3ceb6bc69aa6067ce7ea453e1c984db39725bb4 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 9 May 2006 23:34:51 +0000
Subject: [PATCH] Change time format in job completion logging
 (JobCompType=jobcomp/filetxt)     from "MM/DD HH:MM:SS" to "YYYY-MM-DD
 HH:MM:SS", conforming with the ISO8601     standard format.

---
 NEWS                                          | 5 ++++-
 src/plugins/jobcomp/filetxt/jobcomp_filetxt.c | 7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 7004a2c037e..5576fb42259 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,10 @@ documents those changes that are of interest to users and admins.
  -- Plug a bunch of memory leaks in various places.
  -- Bluegene - before assigning a job to a block the plugin will check the bps
     to make sure they aren't in error state.
-
+ -- Change time format in job completion logging (JobCompType=jobcomp/filetxt)
+    from "MM/DD HH:MM:SS" to "YYYY-MM-DD HH:MM:SS", conforming with the ISO8601 
+    standard format.
+ 
 * Changes in SLURM 1.1.0-pre6
 =============================
  -- Added logic to "stat" a running job with sacct option -S use -j to specify
diff --git a/src/plugins/jobcomp/filetxt/jobcomp_filetxt.c b/src/plugins/jobcomp/filetxt/jobcomp_filetxt.c
index d07d4cc991e..5d9a1154aeb 100644
--- a/src/plugins/jobcomp/filetxt/jobcomp_filetxt.c
+++ b/src/plugins/jobcomp/filetxt/jobcomp_filetxt.c
@@ -170,7 +170,8 @@ _get_user_name(uint32_t user_id, char *user_name, int buf_size)
 }
 
 /*
- * make_time_str - convert time_t to string with "month/date hour:min:sec" 
+ * make_time_str - convert time_t to string with "YYYY-MM-DD HH:MM:SS"
+ *                 Note this is the ISO8601 standard format 
  * IN time     - a time stamp
  * IN str_size - size of string buffer
  * OUT string  - pointer user defined buffer
@@ -181,8 +182,8 @@ _make_time_str (time_t *time, char *string, int str_size)
 	struct tm time_tm;
 
 	localtime_r (time, &time_tm);
-	snprintf ( string, str_size, "%2.2u/%2.2u-%2.2u:%2.2u:%2.2u",
-		(time_tm.tm_mon+1), time_tm.tm_mday,
+	snprintf ( string, str_size, "%4.4u-%2.2u-%2.2u %2.2u:%2.2u:%2.2u",
+		(time_tm.tm_year + 1900), (time_tm.tm_mon+1), time_tm.tm_mday,
 		time_tm.tm_hour, time_tm.tm_min, time_tm.tm_sec);
 }
 
-- 
GitLab