How To Tell How Much Time Has Passed?

Having some serious trouble working this one out, any more help is appreciated =)

Basically, I have a merchant NPC in place that the player can buy/sell goods to. When they leave the merchant, it currently resets what he has for sale. But what I want to do, is save the date and time that they left the NPC (already doing) and if they come back and it’s been less than say 10 minutes the current inventory with the items the player sold are in it. But if its been more than 10 minutes, the merchants items have reset.

It’s to give the player an opportunity to re-buy items if they accidentally sold them.