2
Have data_inicio
and data_fim
and I want to know the difference of hours and minutes between them. The data_inicio
will already be saved in the Mysql database as datetime
, data_fim
will pick the date of the moment the user clicks on a button. What is the best way to do this? Convert data_inicio
in milliseconds, compare to data_inicio
and then format the result to display in hours and minutes?
I will use Moment.js. So I can compare dates in the database format in javascript without conversion, for example
2016-11-28 13:00:00
? Thank you– Fernando Zabin
Yes you can. In the documentation itself there are some examples.
– BrTkCa
Very good, but you will load your site with an extra plugin that you don’t need... But the decision is yours.
– Diego Souza