T{ duration f 0 0 0 -5 0 0 }\r
}\r
] [ "2008-05-26T00:37:42.12345-05:00" rfc3339>timestamp ] unit-test\r
+\r
+[\r
+ T{ timestamp\r
+ { year 2008 }\r
+ { month 10 }\r
+ { day 2 }\r
+ { hour 23 }\r
+ { minute 59 }\r
+ { second 59 }\r
+ { gmt-offset T{ duration f 0 0 0 0 0 0 } }\r
+ }\r
+] [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test\r
: rfc822>timestamp ( str -- timestamp )\r
[ (rfc822>timestamp) ] with-string-reader ;\r
\r
+: check-day-name ( str -- )\r
+ [ day-abbreviations3 member? ] [ day-names member? ] bi or\r
+ check-timestamp drop ;\r
+\r
: (cookie-string>timestamp-1) ( -- timestamp )\r
timestamp new\r
- "," read-token day-abbreviations3 member? check-timestamp drop\r
+ "," read-token check-day-name\r
read1 CHAR: \s assert=\r
"-" read-token checked-number >>day\r
"-" read-token month-abbreviations index 1+ check-timestamp >>month\r
\r
: (cookie-string>timestamp-2) ( -- timestamp )\r
timestamp new\r
- read-sp day-abbreviations3 member? check-timestamp drop\r
+ read-sp check-day-name\r
read-sp month-abbreviations index 1+ check-timestamp >>month\r
read-sp checked-number >>day\r
":" read-token checked-number >>hour\r