I want to have a countdown to a unix timestamp: Where it counts down in seconds
Like this:
Expires in: 1d 10h 52m 25s
Heres an example timestamp: 1303725600
How could I do that?
I just made one of those. http://chrischerry.name/coachella
Check out the source for some ideas on how to do it. The "destination" date however isn't specified by a unix time stamp but that's easy enough to do.
var date = new Date(unix_timestamp*1000);
Its multiplied by 1000 because the javascript Date() wants the time in milliseconds, and unixtimestamps are in seconds.