diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-09-25 16:51:08 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-09-25 16:51:08 -0700 |
commit | eb6b1e672c33a9dce0de368a0e954b801f2035d3 (patch) | |
tree | b1b351f20fc3f5591723ceebc74b635bf33fe0e8 /sys/src | |
parent | 022bc980b88ca6c06df2f4055ecc0b62231f01ea (diff) | |
parent | 9f8d62ab644553b11286dbcd283db56c83d6ebdd (diff) |
merge
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/libc/port/date.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/libc/port/date.c b/sys/src/libc/port/date.c index 44ae15696..7be6cb52f 100644 --- a/sys/src/libc/port/date.c +++ b/sys/src/libc/port/date.c @@ -330,7 +330,7 @@ tmfill(Tm *tm, vlong abs, vlong nsec) if(d < 0) d += mdays[m - 1]; - tm->yday = d; + tm->yday = d - 1; for(i = 0; i < m - 1; i++) tm->yday += mdays[i]; if(m > 1 && isleap(y)) @@ -428,6 +428,9 @@ static int switch(c0){ case 0: break; + /* Ignore '?' so we can share parse and format strings */ + case '?': + continue; case 'Y': switch(w){ case 1: n += fmtprint(f, "%*d", pad, tm->year + 1900); break; |