On 28 May 2013 14:49, Karel Zak <kzak@xxxxxxxxxx> wrote: > If I good remember from "my previous life" than for example > PostgreSQL uses Julian calendar for unlimited datetime calculations. > > See https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/datetime.c > > and date2j(), j2date() and j2day() functions. Anyway, I have no clue > if the calculations are correct (in regards to reformation 1752). Inspiring. Perhaps the easiest way to signed year to work is shift year zero to (LONG_MAX / 2). After that the all left to do is to match the week day vs year, month, day equation table with new alignment, and find how 1752 has alteration has to be done. While that's a bit of work I find it much easier than fixing the divisions when negative numbers are involved. (*ehm* not even amateur mathematician talking) -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html