diff --git a/extra/calendar/format/format.factor b/extra/calendar/format/format.factor index d89afe615e..9b349fcc6c 100755 --- a/extra/calendar/format/format.factor +++ b/extra/calendar/format/format.factor @@ -143,13 +143,25 @@ M: timestamp year. ( timestamp -- ) : ymdhms>timestamp ( str -- timestamp ) [ (ymdhms>timestamp) ] with-string-reader ; +: (hms>timestamp) ( -- timestamp ) + f f f + read-00 ! hour + ":" expect + read-00 ! minute + ":" expect + read-00 ! second + f ; + +: hms>timestamp ( str -- timestamp ) + [ (hms>timestamp) ] with-string-reader ; + : (ymd>timestamp) ( -- timestamp ) read-0000 ! year "-" expect read-00 ! month "-" expect read-00 ! day - 0 0 0 0 ; + f f f f ; : ymd>timestamp ( str -- timestamp ) [ (ymd>timestamp) ] with-string-reader ;