var val1=jQuery("#timer").val();// - берет значение 1
var val2=jQuery("#time_end").val();// - берет значение 2
var val1_exploded=explode(':',val1);
var val2_exploded=explode(':',val2);
var val1_timestamp=val1_exploded[0]*60*60+val1_exploded[1]*60;//время в секундах
var val2_timestamp=val2_exploded[0]*60*60+val2_exploded[1]*60;//время в секундах
var total_timestamp= val1_timestamp+ val2_timestamp;
jQuery("#time_end").val(secondsToHm(total_timestamp));//записывает новое значение
function secondsToHm(d) {
d = Number(d);
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
return ((h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m);
}
function explode( delimiter, string ) { // Split a string by string
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: kenneth
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
var emptyArray = { 0: '' };
if ( arguments.length != 2
|| typeof arguments[0] == 'undefined'
|| typeof arguments[1] == 'undefined' )
{
return null;
}
if ( delimiter === ''
|| delimiter === false
|| delimiter === null )
{
return false;
}
if ( typeof delimiter == 'function'
|| typeof delimiter == 'object'
|| typeof string == 'function'
|| typeof string == 'object' )
{
return emptyArray;
}
if ( delimiter === true ) {
delimiter = '1';
}
return string.toString().split ( delimiter.toString() );
}
<form action="t_form.php" method="post">
<div class="col-lg-2">
<label>Время ухода</label>
<input type="time" name="time_end" class="form-control" value="<?php echo $time_today_day; ?>">
</div>
<div class="col-lg-2">
<label>Час:Мин</label>
<input type="time" name="timer" class="form-control" value="00:00">
</div>
<button style="margin-top:22px;" type="sumbit" class="btn btn-primary"><i class="fa fa-check"></i></button>