• Bram Schoenmakers's avatar
    Second attempt to make humanize_date() more deterministic · d9ba2172
    Bram Schoenmakers authored
    This reverts the first attempt (commit
    8310b029), because relative dates in terms of
    hours were printed.
    
    This attempt passes the now object that we just created to humanize(), so that
    will be used as a offset. If we don't supply that object, arrow will create a
    different datetime object representing 'now', which might be slightly off
    w.r.t. the now object we created.  Therefore the floating point arithmetic done
    within the arrow library might not produce the desired results (delta / 86400).
    
    By passing the offset ourselves I was able to produce reliable
    results.
    d9ba2172
Utils.py 3.8 KB