add timestamp>mdtm to calendar.format

db4
Doug Coleman 2009-02-17 17:09:27 -06:00
parent cbe99c4bed
commit 894ba6182e
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,11 @@ IN: calendar.format.tests
timestamp>string
] unit-test
[ "20080504070000" ] [
"Sun May 04 07:00:00 2008 GMT" cookie-string>timestamp
timestamp>mdtm
] unit-test
[
T{ timestamp f
2008
@ -74,3 +79,5 @@ IN: calendar.format.tests
{ gmt-offset T{ duration f 0 0 0 0 0 0 } }
}
] [ "Thursday, 02-Oct-2008 23:59:59 GMT" cookie-string>timestamp ] unit-test

View File

@ -78,6 +78,9 @@ M: integer year. ( n -- )
M: timestamp year. ( timestamp -- )
year>> year. ;
: timestamp>mdtm ( timestamp -- str )
[ { YYYY MM DD hh mm ss } formatted ] with-string-writer ;
: (timestamp>string) ( timestamp -- )
{ DAY ", " D " " MONTH " " YYYY " " hh ":" mm ":" ss } formatted ;