How to add and subtract fom time in MySQL

Luckily for us there is an ADDTIME function we can use to add and remove from times… The syntax is as follows: ADDTIME(datetime,time_to_change) example SELECT `emp_id` , `clock_time` , ADDTIME( ‘-01:00:00’, `clock_time` ) AS new_time FROM `timeclock` Will return emp_id clock_time new_time 10059 08:30:55 07:30:55 10059 08:31:06 07:31:06 10059 08:31:28 07:31:28 10046 08:33:44 07:33:44 An Update example UPDATE `timeclock` SET `clock_time` = ADDTIME( ‘-01:00:00’, `clock_time` ) WHERE `id` BETWEEN 40967 AND 41022

How to create a ‘select all’ checkbox in javascript

For HTML Code:

<input type="checkbox" onClick="toggle(this)" />

<input type='checkbox' name='ss' value='one'  />
<input type='checkbox' name='ss' value='two'  />
<input type='checkbox' name='ss' value='three'  />

We use Javascript:

<script>
  function toggle(source) {
    checkboxes = document.getElementsByName('ss');
    for (var i = 0, n = checkboxes.length; i < n; i++) {
      checkboxes[i].checked = source.checked;
    }
  }
</script>

(more…)