shithub: plan9front

Download patch

ref: 7d108832528eb1ee85a445a562c00b5a8344d882
parent: c67a1784cc34ffec633b61ad3267e13d162be219
author: Ori Bernstein <>
date: Sat Oct 29 14:19:47 EDT 2022

tmdate: provide better parse errors

it's often not obvious what date component caused an error
when eyeballing a date format string and date; make the
error message contain this information.

--- a/sys/src/libc/port/date.c
+++ b/sys/src/libc/port/date.c
@@ -985,7 +985,7 @@
 		tmtimens(tm, abs, tm->nsec, tz);
 	return tm;
-	werrstr("invalid date %s", str);
+	werrstr("invalid %c component in '%s'", c0, str);
 	return nil;
 	werrstr("garbled format %s near '%s'", fmt, p);