you have to capture the start datetime of a timer and save it with LocalStorrage.
then you have to compare the start datetime with the actual date.
you can do this in different ways. one way would be to make a ajaxrequest to a php file, which returns the current date (pretty easy)
another way would be to use https://www.scirra.com/tutorials/940/ho ... -a-project
i personally would use the php and work directly with unix time stamp.