On Monday 03 December 2001 11:49 am, you wrote: > Benjamin Coates <coates at windmail.net> writes: > > Cvs uses getdate, public domain code that parses dates in pretty much any > > format you would want (like "August 12" or "5 weeks ago" or > > "yesterday"...) into a time number, we could use that to make it > > extremely easy to specify which DBR you want. > > This cure is worse than the symptom. > > Of course all the million formats will be used by links on freesites. > All freenet implementations, and maybe even a number of supplemental > tools will have to support every format. The different programs may > not be able to share code (incompatible license, different programming > language), and due to the complexity of parsing they will probably all > understand slightly different sets of formats. > > The original problem was that hex-seconds-since-1969 are difficult to > generate without computer help (not that anybody would /want/ to > generate them when not in front of a computer, but anyway). So a > scheme that translates [YYYYMMDDHHMMSS] into the appropriate > representation would seem enough. If one ignores spaces, dashes and > colons inside the brackets, friendlier representations like > [YYYY-MM-DD HH:MM:SS] are instantly possible. Just enough complexity > to make people comfortable. > > I don't recall people crying for the ability to enter [August 12] in > Freenet URLs. > > If relative dates are really wanted, the syntax could be augmented to > allow [+n] and [-n] with n being seconds. Yes, you'll need a > calculator to compute what 5 weeks worth of seconds are, but freesite > authors only need to do that once.
[timeType:timeValue] This would provide backwards and forwards compatibility and also give clear, strict semantics for the time value. The timeType would define a specific handler for converting the timeValue. Some examples: [getdate:August 12] - August 12, insert year, 0000 hours (12:00 AM) [hex:12cafebabe94g3] - time from epoch in hex [decimal:1234568789] - time from epoch in decimal [date:2001-8-12] - August 8, 2001 [hour:17] - Day of insert at 5 PM [rel:day:-2] - Two days ago [rel:hour:+5] - Five hours from now [rel:date:-0001-3-4] - 1 year, 3 months, and 4 days ago Or most of the date handling could be shoved into just one prefix. If changes are wanted, there is more namespace to change the date handling. The problem we have now is with backwards compatibility - let's improve it with a system that will be easy to maintain backwards compatability on. Scott Young _______________________________________________ Devl mailing list Devl at freenetproject.org http://lists.freenetproject.org/mailman/listinfo/devl
