angular get current timestamp 1

angular get current timestamp

const current = new Date();

current.setHours(0)

current.setMinutes(0)

current.setSeconds(0)

current.setMilliseconds(0)

const timestamp = current.getTime();

Here is what the above code is Doing:
1. We create a new Date object.
2. We set the hours, minutes, seconds, and milliseconds to 0.
3. We get the timestamp of the current date.

Similar Posts