From 06114d0688271930b2ec054c48288de6eb83e19e Mon Sep 17 00:00:00 2001 From: eshizhan Date: Wed, 4 Oct 2017 15:04:09 +0800 Subject: [PATCH] using ISO 8601 format output time for easy sorting Signed-off-by: eshizhan --- README.pod | 4 ++-- expac.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.pod b/README.pod index f59da46..dc861d8 100644 --- a/README.pod +++ b/README.pod @@ -73,7 +73,7 @@ Interpret targets as paths to local files. =item B<-t, --timefmt> Output time described by the specified I. This string is passed directly -to strftime(3). The default format is %c. +to strftime(3). The default format is %FT%T. =item B<-v, --verbose> @@ -182,7 +182,7 @@ List the oldest 10 installed packages (by build date): =over 4 - $ expac --timefmt=%s '%b\t%n' | sort -n | head -10 + $ expac '%b\t%n' | sort | head -10 =back diff --git a/expac.c b/expac.c index d4d51fe..36fa3f1 100644 --- a/expac.c +++ b/expac.c @@ -42,7 +42,7 @@ #define DEFAULT_DELIM "\n" #define DEFAULT_LISTDELIM " " -#define DEFAULT_TIMEFMT "%c" +#define DEFAULT_TIMEFMT "%FT%T" #define SIZE_TOKENS "BKMGTPEZY\0" #ifndef PATH_MAX @@ -147,7 +147,7 @@ static void usage(void) " -d, --delim separator used between packages (default: \"\\n\")\n" " -l, --listdelim separator used between list elements (default: \" \")\n" " -p, --file query local files instead of the DB\n" - " -t, --timefmt date format passed to strftime (default: \"%%c\")\n" + " -t, --timefmt date format passed to strftime (default: \"%%FT%%T\")\n" " --config read from for alpm initialization (default: /etc/pacman.conf)\n\n" " -v, --verbose be more verbose\n\n" " -h, --help display this help and exit\n\n"