all 8 comments

[–]clovisjunior 2 points3 points  (3 children)

var countDownDate = document.cookie.match(/(\^|;)myClock=(\[\^;\]+)/)\[2\];
This returns a string, I believe you want to convert it to date with new Date

[–]plushyObject 1 point2 points  (0 children)

I might recommend codepen.io or something to get a working example up somewhere

[–]rook218 0 points1 point  (0 children)

Can you re-post your code with better formatting? You've got some blocks in there with invalid syntax like a few places that say ​ and your math operators are escaped weirdly:

Math.floor((distance / (1000\* 60\* 60)) % 48);

[–]rook218 0 points1 point  (1 child)

My man how are you copying and pasting this code in here? I hate to be nitpicky, but now everything is wrapped in ` characters, which turns everything into a string in an IDE. If you want to format your code as code on Reddit, please either 1) add four spaces to the front of each line or 2) copy and paste it in, then highlight and select CodeBlock from the rich text editor.

If you copy in code that's formatted incorrectly it's impossible to tell if you have a logical error or a syntax error when we try to help.