"Alexander Veit" <[EMAIL PROTECTED]> writes: > I would suggest format specifiers to output the date as a julian > date with and without day fraction, e.g. > > # date --date='2003-09-10' +%u > 2452893
Only if you're 12 or more hours ahead of UTC; otherwise the correct answer is 2452892. Or did you intend Julian dates to respect the time zone? But the common practice is that they're always UTC. The wonderful thing about Julian dates is that there are so many of them: Julian Date (which starts at noon) Julian Day (the floor of the Julian Date) Modified Julian Date (which starts at midnight) Truncated Julian Date MJD = JD - 2400000.5 TJD = MJD - 40000 etc., etc. I think we'll run out of format letters before we can add all the variants. > Implementations may use the Jean Meeus or the Fliegel-Van Flandern > algorithm. I don't see why these would be needed. Come to think of it, I don't see why 'date' needs to be modified at all. Can't you just use "TZ=UTC0 date +%s", divide the result by 86400, and add the appropriate constant? That will let you easily generate any of the above flavors of Julian date. (Unless you're worried about leap seconds; but most sites don't have leap seconds.) _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils
