diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-18 02:24:09 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-18 02:24:09 -0500 |
| commit | e8ac422bc8b03c9b2c3735578aab7049092c7c5a (patch) | |
| tree | 9682ba7547f5311ed2471fca02da5d32dba9e9f1 /src | |
| parent | 8f14d6dd1293e0f1e2d3f65b596f0fa6f162a383 (diff) | |
| download | unalf-e8ac422bc8b03c9b2c3735578aab7049092c7c5a.tar.gz | |
With -v, print midnight as 12:00a and noon as 12:00p.
Diffstat (limited to 'src')
| -rw-r--r-- | src/listalf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/listalf.c b/src/listalf.c index e94b95a..c4cd713 100644 --- a/src/listalf.c +++ b/src/listalf.c @@ -31,10 +31,9 @@ void format_msdos_time(char *buf) { hour = t >> 11; min = (t >> 5) & 0x3f; - /* midnight prints as 12pm, not 12am... but 0:01 (1 min past - midnight) prints as 12:01am */ - if(hour == 0 && min == 0) hour = 24; - + /* midnight is 12:00a (unlike arc, which uses 0:00a). noon + is 12:00p (same as arc). could just use a 24h clock like + unzip does, but AM/PM are more intuitive to me. */ ampm = (hour > 11 ? 'p' : 'a'); hour %= 12; |
