> Well, every reasonable programming language out there has date functions. > And in all languages I know it is very easy to convert between dates and > seconds-since-epoch.
It is significantly more complicated to do calendar-based date calculations than to use seconds since the epoch. Every reasonable programming language has a one line call to get seconds since the epoch. Additionally, as I said before, it's easy to enumerate through a bunch of dates. I've already implemented both approaches in Java and seconds since the epoch is way easier. > And the yymmdd approach has the advantage that the number is human-readable. True, but I think the benefit to ease of programmability wins here since people aren't going to really want to read key index keys. I expect that they will only be accessed from behind an API. > Another problem is - in different timezones, don't you get different values > for midnight? No, I meant seconds since the epoch from midnight GMT on the current day. Or, basically, get seconds since the epoch and chop off the minutes and seconds. Each day has 86400 seconds. So, x=seconds since the epoch. If y is to be seconds since the epoch of midnight GMT of the current day, y=x-(x%86400). So without using a calendar you can get everyone using the same index value. This especially simplifies coding in C by an order of magnitude. > Where do you put the date information then? At the end, separated by a > minus, like I did? Yes, I think that's how I'll do it. So prefix-date-number. _______________________________________________ Devl mailing list Devl at freenetproject.org http://lists.freenetproject.org/mailman/listinfo/devl
