I would like to go with Eonasdan datetime picker library. (v. 4.17.47
)
I need to include into bootstrap template a simple form (GET method) that will allow user to pickup a date and time.
The time selection must have 1 minute granularity.
When submit button is clicked I would like the user selection to be sent out as an epoch format.
In my example below, epoch format is indeed being sent but extra seconds are added to the timestamp and I would like to avoid that, this must be due to onchange
function.
How could I get the epoch timestamp value being the real mirror of user selection rounded at the nearest minute?
http://jsfiddle.net/lcoulon/ze2x8358/
$('#datetimepicker1').datetimepicker({
locale: 'fr',
});
// Sends epoch (unix time) into epoch-start-time form
$('#datetimepicker1').on(`dp.change`, X => $('#epoch-start-time').val(X.date.unix()));