The answer to your question depends on your jurisdiction. Under Penal Code 4019(f), he will receive what is known in California as good time credits. That section of law states that for every 4 days served without getting in trouble while incarcerated he will earn 6 days of credit. So after 12 days of actual custody he will have 18 days credit. With two more actual days he will have served the entire sentence. Thus in 14 days of no discipline custody he will have completed his commitment. However heavily populated areas often give an early release to prisoners based on the facilities needs.
There are often alternative sentencing programs such as work relase, home dentention or work furlough were a person can serve time without have to be in locked up. Contact your local jailing authority or the probation department for more information.