here in the colonies, these things are sometimes called 'shaggy dog stories', although the dictionary definition of that is slightly different; others just call them 'groaners' -- and, of course, someone coined a word for them: feghoots. here is a shaggy dog written by Isaac Asimov:

Monty Stein, in the year 3047, committed quite a heist and made off with
quite a tidy sum. He was eventually caught, and the judge sentenced him to
seven years imprisonment. However, the night before his impending
incarceration, he calmly set his time machine for seven years and one day,
and stepped through.

When he emerged in 3054, there was quite an uproar. Prosecution
maintained that Monty Stein never actually served the sentence, since
effectively no time passed for him. Defense stated that the effect was
basically the same, since he lost seven years of living in society, or
something to that effect. Both sides called each other names (as lawyers are
wont to do).

Eventually, Stein was set free. Some say that the judge succumbed to peer
pressure; others said that he simply couldn't resist the temptation. For his
decision, in full, was:

"A niche in time saves Stein."

http://members.aol.com/tsuwm/