Helical Alpha Code

dynDate: dynamic date changer

Now I know that telling a little white lie isn't exactly proper. However, the ignorance of users sometimes makes such lies necessary. It's well-known that static content often loses readership simply because it doesn't say "Last updated thirteen seconds ago!" in bold type somewhere in the sidebar. However, you know as well as I do that not all content changes every thirteen seconds. As a matter of fact, most content never changes throughout its lifetime, though content may well be added.

To your rescue is dynDate. All you have to do is drop dynDate somewhere readable, give it a writeable touchfile, and set the timer. Included in your page, it will simply echo the last-modified date.

To set dynDate, enter the period for your update cycle, in days. Sixty days seems to work well. Keep in mind that this is the maximum point, rather than the centre point, of the following blur function.

You then set the amount of "blur" in days. The date will be changed approximately in accordance with the period, with the period being the maximum, and the date changing somewhere in the interval of two times the period below the maximum. For example, a sixty-day period with an eight-day blur would result in the date being updated every forty-four to sixty days. This makes it look a bit more "human" to your regulars.

And there . . . that's not such a big lie, is it? It technically was updated (in however minute a degree), after all, eh?

To Do

dynDate | Download Source | View Source