The governing body of a city, county, city and county, or political subdivision of the State may grant leaves of absence to employees to appear as a witness in court other than as a litigant, to serve on a jury, or to respond to an official order from another governmental jurisdiction for reasons not brought about through the connivance or misconduct of the employee. The governing body may grant such leaves of absence with pay up to the amount of the difference between the employee’s regular earnings and any amount he receives for jury or witness fees.