es.date.now.js 422 B

123456789101112131415
  1. // TODO: Remove from `core-js@4`
  2. var $ = require('../internals/export');
  3. var global = require('../internals/global');
  4. var uncurryThis = require('../internals/function-uncurry-this');
  5. var Date = global.Date;
  6. var getTime = uncurryThis(Date.prototype.getTime);
  7. // `Date.now` method
  8. // https://tc39.es/ecma262/#sec-date.now
  9. $({ target: 'Date', stat: true }, {
  10. now: function now() {
  11. return getTime(new Date());
  12. }
  13. });