         60 / + *
     ] if ;
 
+: read-ymd ( -- y m d )
+    read-0000 "-" expect read-00 "-" expect read-00 ;
+
+: read-hms ( -- h m s )
+    read-00 ":" expect read-00 ":" expect read-00 ;
+
 : (rfc3339>timestamp) ( -- timestamp )
-    read-0000 ! year
-    "-" expect
-    read-00 ! month
-    "-" expect
-    read-00 ! day
+    read-ymd
     "Tt" expect
-    read-00 ! hour
-    ":" expect
-    read-00 ! minute
-    ":" expect
-    read-00 ! second
+    read-hms
     read-rfc3339-gmt-offset ! timezone
     <timestamp> ;
 


: pad-00 number>string 2 CHAR: 0 pad-left ;

: write-00 pad-00 write ;

: (timestamp>string) ( timestamp -- )
    dup day-of-week day-abbreviations3 nth write ", " write

    [ (timestamp>hms) ] with-string-writer ;

: timestamp>ymdhms ( timestamp -- str )
    >gmt
    [
        dup (timestamp>ymd)
        " " write
