$include $lib/alynna lvar timedelta ( float:_timedelta The speed of time n:1 compared to OOC time ) lvar months ( list:_months An array of months in list format ) lvar tlabel ( str:_tlabel Abbreviation indicating the beginning of relative time (like AD) ) lvar year_t ( float:_year_t The IC year that corresponds to the OOC year 2000. Set this and the program does the rest ) lvar time_t ( float:_time_t 01/01/2000 IC time will be skewed relative to the float time_t. This is in seconds. ) lvar init ( NUMBERs.important ) ( EPOCH: systime of 01/01/2000 00:00:00 ) $def EPOCH 946713600 ( YEAR20: 20 years in seconds, used to get accurate dates for years past they year 2038 bug ) $def YEAR20 631152000 ( YEAR4: 4 years in seconds, used to get accurate dates around leap years ) $def YEAR4 126230400 ( YEAR1: 1 year in seconds, non leap. Used to get accurate dates around single years ) $def YEAR1 31622400 $def defmonths { "January" "Feburary" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December" }array : config.sys prog "_timedelta" getprop tofloat dup not if pop 1.0 then timedelta ! prog "_months" array_get_proplist dup array_count 12 = not if pop defmonths then months ! prog "_tlabel" getprop dup not if pop "AD" then tlabel ! prog "_time_t" getprop tofloat dup not if pop 0.0 then time_t ! prog "_year_t" getprop tofloat dup not if pop 2000.0 then year_t ! 1 init ! ; : unix0k[ f:unixtime -- f:zerotime ] unixtime @ epoch - ( Time since 01/01/2000 is normalized to 01/01/1970 and treated like 01/01/0000 ) ; : unix2k[ f:zerotime -- f:unixtime ] zerotime @ epoch - ( Time since 01/01/0000 is normalized to 01/01/1970 and treated like 01/01/2000 ) ; ; years2seconds[ i:years -- f:seconds ] years @ 365 86400 * * ( Regular years ) years @ 4 / 86400 * + ( Add leap years ) years @ 100 / 86400 * - ( Remove leap centuries ) ; ; seconds2years[ f:seconds -- f:years ] ; : ictime[ -- shit ] init @ not if config.sys then systime_precise unix2k ( Seconds since 01/01/2000 ) time_t @ + ( Skew IC time as needed ) year_t @ years2seconds + ( Add necessary years ) timedelta @ * ( How fast does time go ) ; PUBLIC ictime $libdef ictime : icyear[ f:time-f -- i:year ] init @ not if config.sys then time-f @ year1 / year_t @ + 0 round ; PUBLIC icyear $libdef icyear : time2str[ float:time-f -- str:time-s ] init @ not if config.sys then ; PUBLIC time2str $libdef time2str : str2time[ str:time-s -- float:time-f ] init @ not if config.sys then ; PUBLIC str2time $libdef str2time : ictimefmt[ str:format float:time-f -- str:timestring ] init @ not if config.sys then format @ "%A %B %e, %Y" "%C" subst "%x %X" "%c" subst "%m/%d/%y" "%D" subst "%m/%d/%y" "%x" subst format ! time-f @ icyear tostr var! curyear format @ curyear @ "%Y" subst "000" curyear @ strcat dup strlen 2 - strcut swap pop "%y" subst format ! format @ time-f @ toint YEAR20 % timefmt ; PUBLIC ictimefmt $libdef ictimefmt : autoexec.bat { "The OOC time is: " "%C" systime timefmt "AD, " "%X" systime timefmt "." systime_precise 2 round tostr "." split swap pop }cat "Time" pretty tellme { "The IC time is: " "%C" ictime ictimefmt tlabel @ ", " "%X" ictime ictimefmt "." systime_precise timedelta @ * 2 round tostr "." split swap pop }cat "Time" pretty tellme ; : main config.sys autoexec.bat ;