Easier INS and DEL tags with TextExpander

April 1, 2007

The INS and DEL tags in HTML both recommend a straightforward-but-complicated date/time stamp:

A four-digit year a dash a two-digit month a dash a two-digit day

Then the letter “T” (for Time?)

Then two-digit hour (0-23) a colon a two-digit minute a colon a two-digit second

Then a 3 letter code for time zone, such as PST.

There are a two problems with that:

1) It’s complicated

2) Even if you do insert it, and IF someone looks at it (which isn’t easy), it’s not easy to read

My idea:

1) Have TextExpander format it properly, and, of course, automatically.

2) Have TextExpander also add a “title” attribute, which is much more likely to be seen (perhaps on mouseover)

3) Have the “title” version be more easily readable.

So I came up with this:

<ins datetime=”%Y-%m-%dT%H:%M:%SZZZ” title=”This text was inserted at %1I:%M:%S %p on %Y-%m-%d”>%|</ins>

which expands to this (for example)

<ins datetime=”2007-03-31T21:02:36ZZZ” title=”This text was inserted at 9:02:36 PM on 2007-03-31”></ins>

and puts the cursor between the two tags.

Note that you’d have to manually change “ZZZ” to be your time-zone, as TextExpander doesn’t have a code for that (yet? I can never remember if it is EDT or EST, so it’d be helpful for me if TE did this automatically). W3.org uses an example with -05:00 which (again) seems overly complicated. I mean 1994-11-05T08:15:30-05:00 gives me a headache just looking at it. It looks like a bad Calculus formula or something; however, it probably does make it easier on people who don’t really know what “Eastern” or “Pacific” time is. Honestly, for most of us, the time zone data will never be all that important.

I made my TextExpander shortcut <ins following my habit of always using the actual HTML code. Why? Because TE is supposed to save me time, but if I have to remember my shortcuts, well, that’s an extra thing for me to remember. Plus I don’t use INS or DEL all that often, so I might forget I had a shortcut. I suppose I could use <<ins instead but I prefer <ins

Obviously a DEL tag would look like this:

<del datetime=”%Y-%m-%dT%H:%M:%SZZZ” title=”This text was deleted at %1I:%M:%S %p on %Y-%m-%d”>%|</del>

Note: INS and DEL also have an optional “cite” attribute which I have omitted because I doubt I would ever use it. YMMV. Adapt at will.

blog comments powered by Disqus

Previous post:

Next post: