> But then things go wrong in the rare cases when you change your
> timezone.
I have learned much and now use two new words which solve my problem:
: local-ymd>timestamp ( str -- timestamp ) ! str is YYYY-MM-DD
ymd>timestamp gmt-offset-duration >>gmt-offset
;
: days-since ( str -- n ) ! str is YYYY-MM-DD
today swap local-ymd>timestamp time- duration>days
;
The name local-ymd>timestamp warns that changing timezone is dangerous.
The word days-since gives an example where local-ymd>timestamp is
useful.
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk