The format you're proposing would work. Just use man date (Linux) to output the date/time appropriately, and then substract from it the current time (same format), so you'd get (for example)
diff = $((201109211410 - 201109211310 ))
if [[ $diff -ge 100 ]]
then
echo "1 hour has passed"
else
echo "Wait a bit longer"
fi
What do you mean by "any format" because if the format changes then any script no matter how well written wont work so decide on a format and stick to it and use perl...but if you insist on the shell then a format like YYYYMMDHHMMSS is viable for time diffs.
Well, then stay consistent. In your original example, you gave the date as YYYYMMDDhhmm, so anything >= 100 would mean 1 hour has passed. Now you're using YYMMDDhhmmss, you if you apply even a tiny bit of logical thinking you'd see that 100 wouldn't fit anymore, but that you have to shift it left by 2 places!!