About 51 results
Open links in new tab
  1. How do I get the current date in JavaScript? - Stack Overflow

    Oct 7, 2009 · 3046 Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be …

  2. javascript - date = new Date (); date.valueOf () vs Date.now () - Stack ...

    However Date.now could be a static function of the global Date object, that does simple math on the value reported from the OS I didn't check the source code of all JavaScript engines to make sure that …

  3. javascript - Get a UTC timestamp - Stack Overflow

    Nov 21, 2018 · How can I get the current UTC timestamp in JavaScript? I want to do this so I can send timestamps from the client-side that are independent of their timezone.

  4. javascript - performance.now () vs Date.now () - Stack Overflow

    Jun 12, 2015 · See caniuse page. Date.now() is relative to the Unix epoch (1970-01-01T00:00:00Z) and dependent on system clock. Use cases include same old date manipulation ever since the beginning …

  5. javascript - How to get the current date or/and time in seconds - Stack ...

    Jan 1, 2001 · For example, the following bitwise expression (new Date() / 1000) | 0, is less preferred than Math.floor(Date.now() / 1000), because it causes the following issues: By default Javascript …

  6. javascript - Difference between Date.now (), new Date ().getTime ...

    Sep 28, 2021 · Date.now() gives you the timestamp right now. Date.getTime() gives you the timestamp of a date object that may represent a moment in the past or future. +new Date is a slightly confusing …

  7. How do I get a timestamp in JavaScript? - Stack Overflow

    Date, a native object in JavaScript is the way we get all data about time. Just be careful in JavaScript the timestamp depends on the client computer set, so it's not 100% accurate timestamp.

  8. javascript - Accuracy of Date.now () in browsers - Stack Overflow

    Jul 19, 2019 · I've seen plenty of questions about how to get the date/time in JavaScript, and the answers always look something like Date.now() returns the UTC timestamp in milliseconds But how …

  9. javascript - Performance of Date.now () vs (new Date).getTime ...

    var now = new Date(); and then wait a while, a subsequent call to now.getTime() will tell the time at the point the variable was set.

  10. javascript - How to convert a Date to UTC? - Stack Overflow

    Suppose a user of your website enters a date range. 2009-1-1 to 2009-1-3 You need to send this date to a server for some processing, but the server expects all dates and times to be in UTC. Now su...