Allan Lobo
Allan Lobo

Reputation: 23

Get DateTime and the Difference JS

I want to know how to get a Datetime and take the diffrence in Java Script, i know how to do it just in SQL,

I need this for a Employee point system. He will enter and starts the day, generating the date and time ( ex: 23/07/2020 08:00:00 ). After, he will end the day and take the date and time ( ex: 23/07/2020 18:00:00 ).

I need to take the Date and after the difference to give a time, like: "You worked 10:00:00".

Upvotes: 0

Views: 53

Answers (1)

Martin Munilla
Martin Munilla

Reputation: 302

you can do it easilly with momentjs , it is a package that allows you to manage dates super easy and with no problems, you can add or subtract dates, and you can also show them with any format you want, this are only a few examples but you can do a lot more with it

Upvotes: 1

Related Questions