summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorarza <arza@arza.us>2022-10-20 17:20:51 +0300
committerBenBE <BenBE@geshi.org>2023-07-31 09:50:04 +0200
commit78c7b1c86bee3c188b3fe7acbbde548b34c9340a (patch)
treebab4fa201b9d12e32c502bace0701d4c6d90a55b /Process.c
parent5558c015f6699c9da47d1cb871318c23dedd4919 (diff)
Show year as start time for processes older than a year
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Process.c b/Process.c
index 1424d6ef..3c60c8b8 100644
--- a/Process.c
+++ b/Process.c
@@ -274,8 +274,13 @@ void Process_printTime(RichString* str, unsigned long long totalHundredths, bool
void Process_fillStarttimeBuffer(Process* this) {
struct tm date;
+ time_t now = time(NULL);
(void) localtime_r(&this->starttime_ctime, &date);
- strftime(this->starttime_show, sizeof(this->starttime_show) - 1, (this->starttime_ctime > (time(NULL) - 86400)) ? "%R " : "%b%d ", &date);
+
+ strftime(this->starttime_show,
+ sizeof(this->starttime_show) - 1,
+ (this->starttime_ctime > now - 86400) ? "%R " : (this->starttime_ctime > now - 364*86400) ? "%b%d " : " %Y ",
+ &date);
}
/*

© 2014-2024 Faster IT GmbH | imprint | privacy policy