write: Improve help text of --writer.
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index 261054df8fc4012236b42246158b87b77ce1623c..f14440e6fb903548e25ccfdf611f4c2f2881aa49 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -696,7 +696,13 @@ static int get_local_time(uint64_t *seconds, char *buf, size_t size,
                        return -E_STRFTIME;
                return 1;
        }
-       if (!strftime(buf, size, "%b %e %Y", tm))
+       /*
+        * If the given time is more than six month away from the current time,
+        * we print only the year. The additional space character in the format
+        * string below makes the formated date align nicely with dates that
+        * contain the time (those written by the above strftime() statement).
+        */
+       if (!strftime(buf, size, "%b %e  %Y", tm))
                return -E_STRFTIME;
        return 1;
 }