get-midnight-date

Takes Date object and returns another Date object set to the same date at midnight local time.

Usage no npm install needed!

<script type="module">
  import getMidnightDate from 'https://cdn.skypack.dev/get-midnight-date';
</script>

README

get-midnight-date

Takes Date object and returns another Date object set to the same date at midnight local time.

Install

$ npm install get-midnight-date --save

Usage

const GetMidnightDate = require('get-mignight-date');

let currentTime = new Date();
let today = GetMidnightDate(currentTime);