Commit c5a441ac authored by Russ Cox's avatar Russ Cox

do not crash printing the zero value for time.Time.

R=r
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=34605
CL=34608
parent 1a0860b9
......@@ -250,6 +250,7 @@ var shortDayNames = []string{
}
var shortMonthNames = []string{
"---",
"Jan",
"Feb",
"Mar",
......@@ -301,7 +302,7 @@ func format(t *Time, fmt string) string {
case 'a': // %a abbreviated weekday name
bp = addString(buf, bp, shortDayNames[t.Weekday]);
case 'b': // %b abbreviated month name
bp = addString(buf, bp, shortMonthNames[t.Month-1]);
bp = addString(buf, bp, shortMonthNames[t.Month]);
case 'd': // %d day of month (01-31)
decimal(buf[bp:bp+2], t.Day);
bp += 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment