When in doubt, always call and ask. I've found that, as people say, the agents may have some latitude here and there.
This is really splitting a hair, but I had an upgrade code and it was for 12 hours ahead. So with my departure at 7AM the next morning and return at 6PM the next evening, I waited till after 7PM the night before departure and called to use the code. The agent asked me which leg I'd like the upgrade for. I didn't know I could use it for the return, that far ahead of time.
Maybe when they say within 12 hours, they mean before the entire trip starts, not that particular leg. What I learned from it is to always call and ask - you never know what you might get. Worst case, you just learn what they won't do for you, but we're talking about freebies anyway, in most cases.