I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp. Ideally, the use would be something like:
$ cat somefile.txt | prepend-timestamp
(Before you answer sed, I tried this:
$ cat somefile.txt | sed "s/^/`date`/"
but that only evaluates the date command once when sed is executed, so the same timestamp is incorrectly prepended to each line.)
Note on the accepted answer below: strftime() appears to be a GNU awk extension, so if you're on Mac OS, for example, use gawk instead of awk.