Paste: 9-based time

Author: randy7
Mode: factor
Date: Thu, 15 Jan 2009 17:12:26
Plain Text |
USING: calendar kernel math math.functions math.parser
sequences ;

IN: 9time
 
: insert-between ( str joiner -- str' ) 
    [ [ 1string ] { } map-as ] dip join ;


: nine-time ( date -- 9time )
    now swap time-
    duration>seconds floor
    9 >base [ string>number ]
            [ length "1" <repetition> concat string>number ] bi
    + 
    number>string ":" insert-between ;

1992 5 13 <date> nine-time .

New Annotation

Summary:
Author:
Mode:
Body: