add timestamp>mdtm to calendar.format
parent
cbe99c4bed
commit
894ba6182e
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue