-2

I'm using countdown-inline JS and I've got the following code:

var diff = options.timestamp;
var df = new Date(diff);

var d = Math.floor(df / (60 * 60 * 1000 * 24) * 1),
    h = Math.floor((df % (60 * 60 * 1000 * 24)) / (60 * 60 * 1000) * 1),
    m = Math.floor(((df % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) / (60 * 1000) * 1),
    s = Math.floor((((df % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) % (60 * 1000)) / 1000 * 1);

How ms (milliseconds) var should look like into above iteration?

What's the formula please?

adiga
  • 34,372
  • 9
  • 61
  • 83
Cicharito
  • 131
  • 5
  • 17
  • Does this answer your question? [Formatting a date in javascript till the millisecond](https://stackoverflow.com/questions/9212889/formatting-a-date-in-javascript-till-the-millisecond) – Gerard Nov 20 '19 at 08:59

1 Answers1

0
var df = new Date();
///...
var ms = df.getTime() % 1000;