make unknown elements f instead of 0

add hours:minutes:seconds
db4
Doug Coleman 2008-03-05 16:10:29 -06:00
parent 914456f315
commit 82ed128f47
1 changed files with 13 additions and 1 deletions

View File

@ -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 <timestamp> ;
: 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 <timestamp> ;
f f f f <timestamp> ;
: ymd>timestamp ( str -- timestamp )
[ (ymd>timestamp) ] with-string-reader ;