: bienniums ( x -- duration ) instant swap 2 * >>year ;
: trienniums ( x -- duration ) instant swap 3 * >>year ;
: quadrenniums ( x -- duration ) instant swap 4 * >>year ;
+: quinquenniums ( x -- duration ) instant swap 5 * >>year ;
+: sexenniums ( x -- duration ) instant swap 6 * >>year ;
+: septenniums ( x -- duration ) instant swap 7 * >>year ;
+: octenniums ( x -- duration ) instant swap 8 * >>year ;
+: novenniums ( x -- duration ) instant swap 9 * >>year ;
: lustrums ( x -- duration ) instant swap 5 * >>year ;
: decades ( x -- duration ) instant swap 10 * >>year ;
: indictions ( x -- duration ) instant swap 15 * >>year ;
USING: combinators kernel system vocabs ;
IN: time
-HOOK: set-time os ( timestamp -- )
+HOOK: set-system-time os ( timestamp -- )
HOOK: adjust-time-monotonic os ( timestamp -- seconds )
{
: timestamp>timezone ( timestamp -- timezone )
gmt-offset>> duration>minutes 1 \ timezone <struct-boa> ; inline
-M: unix set-time
+M: unix set-system-time
[ unix-1970 time- duration>microseconds >integer make-timeval ]
[ timestamp>timezone ] bi
settimeofday io-error ;
windows.kernel32 kernel classes.struct calendar ;
IN: time.windows
-M: windows set-time
+M: windows set-system-time
>gmt
timestamp>SYSTEMTIME SetSystemTime win32-error=0/f ;
! See http://factorcode.org/license.txt for BSD license
USING: accessors calendar calendar.english combinators
command-line formatting grouping io kernel math.parser
-math.ranges namespaces sequences sequences.extras strings.tables
-;
+math.ranges namespaces sequences sequences.extras strings.tables ;
IN: tools.cal
<PRIVATE
: days ( timestamp -- days )
- beginning-of-month
+ start-of-month
[ day-of-week " " <repetition> ]
[ days-in-month [1,b] [ "%2d" sprintf ] map ] bi append
42 " " pad-tail ;