week are judged to refer to a day in the past (e.g., telling \fIpick\fR
`saturday' on a `tuesday' means `last\ saturday'
not `this\ saturday').
+Further more, dates in a simplified ISO 8601/RFC 3339 style (e.g.
+`YYYY-MM-DD' or `YYYY-MM-DD hh:mm:ss') are accepted.
Finally, in addition to these special specifications,
.B pick
will
tw.tw_sec = atoi(++cp); SKIPD(); } }
#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \
tw.tw_flags |= TW_SZEXP; SKIPD(); }
+#define SETZONEC(h, m) { tw.tw_zone = (h)*60+(m); \
+ tw.tw_flags |= TW_SZEXP; SKIPD(); }
#define SETDST() { tw.tw_flags |= TW_DST; }
#define SKIPD() { while ( isdigit(*cp++) ) ; --cp; }
#define SKIPTOD() { while ( !isdigit(*cp++) ) ; --cp; }
SKIPTOD();
SETYEAR();
}
-{D}("-"|"/"){D}("-"|"/"){YEAR}{W}{TIME} {
+{d}{4}"-"{d}{2}"-"{d}{2}(" "|"T"){TIME} {
+ INIT();
+ SETYEAR();
+ SKIPTOD();
+ SETMON_NUM();
+ SKIPTOD();
+ SETDAY();
+ SKIPTOD();
+ SETTIME();
+}
+{d}{4}"-"{d}{2}"-"{d}{2} {
+ INIT();
+ SETYEAR();
+ SKIPTOD();
+ SETMON_NUM();
+ SKIPTOD();
+ SETDAY();
+}
+{d}{2}"-"{d}{2}"-"{d}{2} {
+ fprintf(stderr, "the highly ambiguous date format XX-XX-XX..."
+ " is no longer supported\n");
+}
+{D}"/"{D}"/"{YEAR}{W}{TIME} {
INIT();
if(europeandate) {
/* DD/MM/YY */
SKIPTOD();
SETTIME();
}
-{D}("-"|"/"){D}("-"|"/"){YEAR} {
+{D}"/"{D}"/"{YEAR} {
INIT();
if(europeandate) {
/* DD/MM/YY */
yyterminate();
}
+"+"{d}{d}":"{d}{d} {
+ INIT();
+ SKIPTOD();
+ SETZONEC(atoi(cp), atoi(cp+3));
+#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
+ zonehack (&tw);
+#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
+ yyterminate();
+}
+"-"{d}{d}":"{d}{d} {
+ INIT();
+ SKIPTOD();
+ SETZONEC(-atoi(cp), -atoi(cp+3));
+#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
+ zonehack (&tw);
+#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
+ yyterminate();
+
+}
{nl}("ut"|"UT") INIT(); SETZONE(0); yyterminate();
{nl}("gmt"|"GMT") INIT(); SETZONE(0); yyterminate();
{nl}("est"|"EST") INIT(); SETZONE(-500); yyterminate();