Sounds like you could use http://www.datejs.com/
They have an example on the main page that does exactly what you're describing!
EDIT: Actually, I think I reversed your question in my head. In any case, I think you could check it out as it's a really great library anyway!
EDIT x2: I'm going to echo what the others have said http://momentjs.com/ is probably the best choice available right now.
EDIT x3: I haven't used date.js in over a year. I'm exclusively using momentjs for all my date related needs.