Search code examples
javascriptdatedatetimeexponentiation

Javascript Date getTime() code snippet with mysterious additional characters


<script language="JavaScript">
var t = new Date();
t.getTime() + -864e5;
</script>

What is that funky code after the "+" at the end of the second line doing?

It is probably made to be hard to understand, since I suspect it's one of the ways they try to protect themselves against scraping.


Solution

  • It is a valid JavaScript number that represents the number of milliseconds in a 24 hour day.

    1000*60*60*24 or 86400000 or 864e5