Times and difference

I’m currently working on a game where I need to save the current time and date when the application closes down. and get the new time when application is loaded and compare how many seconds/minutes the difference is.

I’m using Javascript!

If anyone has a script for this I would really appreciate this, allthough tips and hints are very welcome too!

Pretty much the same question here with an answer you can apply too.