beH -- My short date-and-time stamp format
Last year, I came up with a short date-and-time-stamp syntax.
(I only talk about the date part here.)
It only works well for 2001 through 2026 (although adding uppercase
years would extend it through 2052). I was using it in many of
my weblog entries from early March (e.g., bc1 == 2002 March 1st).
Briefly, it's a three-character string, first one is the year,
a-z for 2001-2026; second is month a-l (1-12); third is the day
of the month (1-9 followed by E-Z or so).
I have a longer python program "tdc" that I use as a
date-and-time-stamp converter; here is a shorter and slightly
obfuscated version of it. I'm sure someone could make a shorter
version in perl.
#!/usr/bin/env python
#
# The "radio" version of tdc: Convert a date/time to my
# screwy format, but only from the form used by the Radio
# UserLand weblog tool's archiver. No time.
#
# Only one argument: yyyy/mm/dd
#
# As they say:
# "Y days hath i, d, f and k. All the rest have Z but b."
#
import sys
from string import digits as d, lowercase as l, uppercase as u
t = [ 2001 * '-' + l, '-' + l, d + u[4:] ]
def main ():
print ''.join( map( lambda p: p[0][ int(p[1]) ],
zip( t, sys.argv[1].split('/') ) ) )
main()
A longer story about this should go onto my lists & systems page.
I've used these as filename prefixes in some situations.
I like it for a few reasons:
because (1) the names are short; (2) the format
(lower+lower+upper-or-digit) is unusual, so it's readily
recognizable as a date stamp; (3) they sort correctly;
and (4) it's not too hard to learn to convert in your head,
at least during the first 10 days of a given month.
I think it would be cool to change the weblog archives to
shorten all of the URLs:
http://radio.weblogs.com/0100945/2002/05/11.html#a144
could become
http://dal.i.am/beF#a144
unless I encoded the entry number, too.
http://dal.i.am/beF#Ao
I'd have to have a hell of a lot of weblog entries before that
would save more than two or three characters, though. Not worth it.
12:27:51 AM