From 1034a65fd868f2d1f16b6af3a82f6e94bc379c6b Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 15 Nov 2005 23:35:24 +0000
Subject: [PATCH] Time format in sinfo/squeue/smap/sacct changed from
 D:HH:MM:SS to D-HH:MM:SS per POSIX standards document.

---
 NEWS               | 2 ++
 src/sacct/sacct.c  | 2 +-
 src/sinfo/print.c  | 2 +-
 src/smap/opts.c    | 2 +-
 src/squeue/print.c | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 5938656982e..5d1622cf8fc 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ documents those changes that are of interest to users and admins.
  -- Change SLURM libraries and associated header files from GPL to LGPL 
     licensing. All other SLURM components are still distributed under 
     the GPL license.
+ -- Time format in sinfo/squeue/smap/sacct changed from D:HH:MM:SS to 
+    D-HH:MM:SS per POSIX standards document.
 
 * Changes in SLURM 0.7.0-pre3
 =============================
diff --git a/src/sacct/sacct.c b/src/sacct/sacct.c
index 554b7e2d852..2d6a22b67e5 100644
--- a/src/sacct/sacct.c
+++ b/src/sacct/sacct.c
@@ -1108,7 +1108,7 @@ char *elapsedTime(long secs, long usecs)
 	minutes = res.quot;
 	seconds = res.rem;
 	if (days) {
-		snprintf(daybuf, sizeof(daybuf), "%d:", days);
+		snprintf(daybuf, sizeof(daybuf), "%d-", days);
 		snprintf(hourbuf, sizeof(hourbuf), "%02d:", hours);
 	} else if (hours)
 		snprintf(hourbuf, sizeof(hourbuf), "%2d:", hours);
diff --git a/src/sinfo/print.c b/src/sinfo/print.c
index 8197c641207..8951db82169 100644
--- a/src/sinfo/print.c
+++ b/src/sinfo/print.c
@@ -142,7 +142,7 @@ static int _print_secs(long time, int width, bool right, bool cut_output)
 
 	if (days) 
 		snprintf(str, FORMAT_STRING_SIZE,
-			 "%ld:%2.2ld:%2.2ld:%2.2ld",
+			 "%ld-%2.2ld:%2.2ld:%2.2ld",
 		         days, hours, minutes, seconds);
 	else if (hours)
 		snprintf(str, FORMAT_STRING_SIZE,
diff --git a/src/smap/opts.c b/src/smap/opts.c
index 94beea99be5..d71a2bf800d 100644
--- a/src/smap/opts.c
+++ b/src/smap/opts.c
@@ -124,7 +124,7 @@ extern void snprint_time(char *buf, size_t buf_size, time_t time)
 
 		if (days)
 			snprintf(buf, buf_size,
-				"%ld:%2.2ld:%2.2ld:%2.2ld",
+				"%ld-%2.2ld:%2.2ld:%2.2ld",
 				days, hours, minutes, seconds);
 		else if (hours)
 			snprintf(buf, buf_size,
diff --git a/src/squeue/print.c b/src/squeue/print.c
index 2efe4962c42..07c35b11cbe 100644
--- a/src/squeue/print.c
+++ b/src/squeue/print.c
@@ -205,7 +205,7 @@ int _print_secs(long time, int width, bool right, bool cut_output)
 
 	if (days) 
 		snprintf(str, FORMAT_STRING_SIZE,
-			 "%ld:%2.2ld:%2.2ld:%2.2ld",
+			 "%ld-%2.2ld:%2.2ld:%2.2ld",
 		         days, hours, minutes, seconds);
 	else if (hours)
 		snprintf(str, FORMAT_STRING_SIZE,
-- 
GitLab