
scope {
    const tm = Fossil.time;
    var n = tm.now();
    var j = tm.unixToJulian(n);
    //print(n, tm.julianToUnix(j));
    //assert n === tm.julianToUnix(j) /* sometimes fails on rounding errors! Soo.... */;
    0.prototype.'operator=~' = proc(l,r){
        affirm 'integer' === typename r;
        return (l===r) || (l===(r-1)) || (l===(r+1));
    };
    assert n =~ tm.julianToUnix(j) /* round-trip sometime rounds badly, so we check for a +/-1 match */;
    unset n.prototype.'operator=~' /* avoid polluting downstream script code */;
    assert 19 === tm.julianToISO8601(j).length() /* w/o ms */;
    assert 23 === tm.julianToISO8601(j,true).length() /* w/ ms */;
}
