I have a line of code that sets a cookie with an expiry date that looks like this.
var date = new Date();
date.setTime(date.getTime() + 1000*60*60*24*365);
var expires = "; expires=" + date.toGMTString();
What I’m trying to do is understand what each number represents. I know thats its just adding milliseconds to the time object but what does each one represent is the question.
1000 milliseconds in a second
60 seconds in a minute
60 minutes in an hour
24 hour in a day
365 days in a year
So, you’ll get the quantity of milliseconds in a year.