Many folks are arrested shortly before midnight and released the next day. When this occurs you are entitled to two days of credit towards any jail sentence or any fine imposed by the Court at the time of sentencing.
The Case of People vs. Smith (1989) 211 Cal App 3d 523 provides the authority for this principle
Since section 2900.5 speaks in terms of "days" instead of "hours," it is presumed the Legislature intended to treat any partial day as a whole day. (In re Jackson (1986) , 441-443 [227 Cal. Rptr. 303]; see also People v. Scroggins(1987) , 508 [236 Cal. Rptr. 569].) (3) "`[W]hen language which is reasonably susceptible of two constructions is used in a penal law ordinarily that construction which is more favorable to the offender will be adopted....' (In re Tartar (1959) , 256-257 [...].)" (People v. Davis (1981) , 828 [176 Cal. Rptr. 521, 633 P.2d 186].) (2b) "The law takes no notice of fractions of a day. Any fraction of a day is deemed a day...." (Municipal Imp. Co. v. Thompson (1927) , 632 [258 P. 955].) (1b) Had the intent been otherwise, the Legislature could easily have provided for credit on the basis of 24-hour periods instead of days.
Many prosecutors will not volunteer this information to a defendant, therefore the accused must request that he or she be given the proper credit at the time sentence is imposed. The benefit for the person receiving a first time sentence can be the equivalent to a couple hundred dollars off a fine.