
189 Cal.App.4th 458 (2010)
116 Cal. Rptr. 3d 883
RICHARD SHELDEN, Plaintiff and Appellant,
v.
MARIN COUNTY EMPLOYEES' RETIREMENT ASSOCIATION et al., Defendants and Respondents.
No. A124912.
Court of Appeals of California, First District, Division Five.
September 24, 2010.
*460 Donald T. Ramsey; Clisham & Sortor and David P. Clisham for Plaintiff and Appellant.
Manatt, Phelps & Phillips, Ashley K. Dunning and Heather Littlejohn for Defendants and Respondents.

OPINION
JONES, P.J.
Appellant Richard Shelden filed a petition for writ of mandate (Code Civ. Proc., § 1085) and administrative mandamus (Code Civ. Proc., § 1094.5) alleging respondents Marin County Employees' Retirement Association (MCERA) and its governing Board of Retirement (Board) calculated his retirement benefits incorrectly. The trial court disagreed and denied the petition. Shelden now appeals arguing the trial court erred when interpreting the controlling statutes. We disagree and will affirm.

I. Factual and Procedural Background

Appellant Richard Shelden worked as a deputy sheriff for the Marin County Sheriff's Office. In the year 2000, Marin County had developed a backlog of approximately 10,000 unserved arrest warrants. Hoping to reduce that backlog, the Marin County Sheriff (Sheriff) decided to create an arrest warrant service team to serve the outstanding warrants. The Sheriff asked Shelden if he wanted to work as a member of the new team. Shelden agreed.
Shelden's work schedule, like that of all deputy sheriffs in Marin County, was established by a collective bargaining agreement between the county and the local deputy sheriff's association. Under that agreement, the standard work schedule consisted of 156 hours in a 28-day period broken into thirteen 12-hour days. The agreement required deputies to work three consecutive days one week and four consecutive days the following week. The cycle would then be repeated with the exception that each employee would be granted an additional day off each 28-day period.
The Sheriff decided that the arrest warrant service team would work "on an overtime basis" so as not to detract from his deputies' regular duties. After discussing the matter, Shelden and his superiors agreed that Shelden would work one eight-hour shift each week on his first day off.
Shelden followed that schedule working overtime one day each week on his regular day off for approximately four years. Each week, Shelden would submit a request for overtime and a supervisor would sign the form.
*461 By 2004, other deputies had begun to complain that Shelden was getting more than his share of overtime hours. Apparently wanting to share those hours and the accompanying overtime pay more equitably, the Sheriff removed Shelden from the arrest warrant service team and established a new policy that no deputy could serve on the team for more than three months at a time.
After working as a deputy sheriff for nearly 30 years, Shelden retired in March 2005.
(1) Marin County employees receive retirement benefits under a plan established pursuant to the County Employees Retirement Law of 1937. (Gov. Code, § 31450 et seq.) Respondents MCERA and its Board are vested with the authority to determine the benefits to which a retiring employee is entitled.
In March 2005, the same month that he retired, Shelden asked MCERA to include the overtime pay he earned while working on the arrest warrant service team when calculating his retirement benefit. MCERA denied Shelden's request explaining he was not entitled to retirement benefits based on overtime that he had served voluntarily.
Shelden appealed that decision to MCERA's Board. The Board denied the appeal in December 2005.
In December 2006, Shelden raised the issue again in a letter to county counsel. After considering that request, the Board referred the matter to an administrative law judge (ALJ) for a hearing.
An administrative hearing on Shelden's request was conducted in October 2007. After hearing the evidence presented, the judge issued a written decision rejecting Shelden's request reasoning that he was not entitled to benefits for time spent working on the arrest warrant service team because those hours were not part of Shelden's normally scheduled or regular working hours.
In January 2008, the Board adopted the ALJ's decision as its own.
In August 2008, Shelden filed the action that is at issue in the current appeal. Framed as a petition for writ of mandate under Code of Civil Procedure section 1085 and a petition for writ of administrative mandamus under Code of Civil Procedure section 1094.5, Shelden argued MCERA and *462 its Board[1] were required to grant him retirement benefits for the time he spent working on the arrest warrant service team.
MCERA opposed the petition. Marin County intervened in the action urging the court to deny Shelden's request.
The trial court set a hearing on the petition. The day before the hearing, the court issued a tentative decision rejecting Shelden's request. Neither party stated an intent to oppose the tentative ruling so that ruling became the court's order. Subsequently, the court issued a judgment and statement of decision restating its tentative decision.
This appeal followed.[2]

II. Discussion

Shelden contends the trial court interpreted and applied the statutes that govern the calculation of his retirement benefit incorrectly.
The first issue we must address is what standard of review is appropriate. The standard of review, in turn, depends upon what was the correct legal procedure to challenge MCERA's decisions. Shelden argues administrative mandamus under Code of Civil Procedure section 1094.5 was the appropriate vehicle to challenge MCERA's decision. MCERA argues that its actions must be evaluated under principles of ordinary mandamus under Code of Civil Procedure section 1085. We agree with MCERA on this point.
(2) Many cases have held that the question of whether a retirement board calculated benefits correctly under applicable laws must be reviewed under principles of ordinary mandamus. (See, e.g., Kern v. City of Long Beach (1947) 29 Cal.2d 848, 850 [179 P.2d 799], and cases cited therein; see also McKeag v. Board of Pension Commrs. (1942) 21 Cal.2d 386, 392 [132 P.2d 198]; Kreeft v. City of Oakland (1998) 68 Cal.App.4th 46, 52 [80 Cal.Rptr.2d 137].) Based on these cases, we conclude MCERA's decision must be evaluated under ordinary mandamus.
Shelden seems to argue administrative mandamus was appropriate because MCERA in fact provided him with an administrative hearing. However, administrative mandamus is only appropriate to review an administrative *463 decision that is made "as the result of a proceeding in which by law a hearing is required to be given . . . ." (Code Civ. Proc., § 1094.5, subd. (a).) If the administrative agency provides a hearing but it was not required by law, administrative mandamus does not apply. (Keeler v. Superior Court (1956) 46 Cal.2d 596, 599 [297 P.2d 967].) The authority Shelden cites does not convince us that MCERA was required to conduct an administrative hearing to evaluate his request for additional retirement benefits. First, Shelden relies on Dickey v. Retirement Board (1976) 16 Cal.3d 745, 749 [129 Cal.Rptr. 289, 548 P.2d 689]; however, that case, at the page cited, simply discusses whether pension benefits are a vested right. The case does not discuss whether a hearing is required. The other case Shelden cites, Watkins v. City of Santa Ana (1987) 189 Cal.App.3d 393, 396 [234 Cal.Rptr. 406], does state that when an employee seeks disability benefits, he is entitled to an administrative hearing to determine whether he is in fact disabled. Here, we are not dealing with disability benefits. We conclude ordinary mandamus is applicable.
Having concluded ordinary mandamus was the appropriate vehicle to challenge MCERA's decision, the correct standard of review comes into focus. A traditional writ of mandate under Code of Civil Procedure section 1085 is used to compel a public entity to perform a legal and usually ministerial duty. (Kreeft v. City of Oakland, supra, 68 Cal.App.4th at p. 53.) The trial court reviews the challenged administrative action to determine whether it was arbitrary, capricious, or entirely lacking in evidentiary support, or whether the agency failed to follow the procedure and give the notices the law requires. (Ibid.) On appeal, the trial court's factual findings must be upheld if they are supported by substantial evidence. (Ibid.) However, legal issues present a question of law that this court reviews de novo on appeal. (Ibid.) With these principles in mind, we turn to the specific arguments presented.
The basic question raised here by the parties is whether MCERA correctly interpreted and applied those statutes that govern the calculation of Shelden's retirement benefits. The parties agree that the pivotal issue when making that calculation is whether the overtime hours Shelden worked can properly be characterized as "compensation earnable" under the applicable statutes. That term is defined in Government Code section 31461.6 as follows: "`Compensation earnable' shall not include overtime premium pay other than premium pay for hours worked within the normally scheduled or regular working hours that are in excess of the statutory maximum workweek or work period applicable to the employee under [the Fair Labor Standards Act]."
(3) The statute's plain language makes clear the general rule that overtime premium play is not included in the term "compensation earnable," but it also sets forth an exception. "Compensation earnable" does include "premium pay for hours worked within the normally scheduled or regular *464 working hours . . . ." (Gov. Code, § 31461.3.) Therefore, the issue here is reduced to whether the overtime hours Shelden worked on the arrest warrant service team were within his "normally scheduled or regular working hours."
(4) The parties presented conflicting evidence on this point. The trial court evaluated that evidence and ruled the hours Shelden worked were not covered by Government Code section 31461.6. Therefore, the pivotal question we must answer is whether the trial court's ruling is supported by substantial evidence. (Kreeft v. City of Oakland, supra, 68 Cal.App.4th at p. 53.) We think it was. The record indicates that Shelden's normal work schedule, like all other deputy sheriffs in Marin County, was to work thirteen 12-hour days every 28-day period. Shelden's work on the arrest warrant service team did not occur during his regular work period. Rather Shelden performed that work on what he characterized as his "day off." Shelden was not ordered or required to perform the work in question. He volunteered to do it, and he could stop at any time. Shelden was not required to take a sick or vacation day if he was unable to work his overtime shift, and he did not pay into the retirement system for the time he spent working on the arrest warrant search team. By contrast, when Shelden was unable to work a regular shift, he was required to take a vacation or sick day, and he paid into the retirement system for his regular work and his regular pay. Finally, Shelden's boss, the Marin County Sheriff, considered Shelden's arrest warrant work to be not part of his regular working hours. The trial court, considering this evidence reasonably could conclude that Shelden's work on the arrest warrant service team was not part of his "normally scheduled or regular working hours." The court's conclusion is well supported.
In arguing that his work on the arrest warrant service team was part of his "normally scheduled or regular working hours" Shelden relies primarily on the fact that he performed that work regularly (once a week) and for a long period of time (about four years). Shelden also cites language in the collective bargaining agreement that recognizes the Sheriff has the right to modify the 12-hour working schedule and he suggests the Sheriff did so in his case. The evidence Shelden cites is noteworthy and it might have supported the trial court's decision if it had ruled in his favor. However, that is not how the trial court ruled. The court ruled against Shelden and as we have stated, its ruling is supported by substantial evidence. If a ruling is supported by substantial evidence, it is irrelevant that the record also includes substantial evidence that would have supported a different conclusion. (Pedra v. Dugan (2004) 123 Cal.App.4th 1483, 1489 [21 Cal.Rptr.3d 36].)
It was procedurally fair (Kreeft v. City of Oakland, supra, 68 Cal.App.4th at p. 53) for MCERA to decline to include Shelden's work on the arrest warrant service team in his retirement calculation. As we have noted, Shelden made *465 contributions to the retirement system for the time he worked on his regular shifts, but he did not make any payments to the retirement system for the time he spent working on the arrest warrant service team. Thus, not only was MCERA's decision consistent with how both parties treated that work when it was being performed, it helped avoid the possibility that MCERA would be faced with an unfunded retirement liability that it had no reason to anticipate.
Having concluded that the trial court ruled correctly, we need not address the other issue the parties address extensively in their briefs: whether Shelden's work on the arrest warrant service team must be excluded from his retirement calculation under Government Code section 31461[3] as interpreted in Ventura County Deputy Sheriffs' Assn. v. Board of Retirement (1997) 16 Cal.4th 483 [66 Cal.Rptr.2d 304, 940 P.2d 891] and Guelfi v. Marin County Employees' Retirement Assn. (1983) 145 Cal.App.3d 297 [193 Cal.Rptr. 343]. Because Shelden's work on the arrest warrant service team was properly excluded under Government Code section 31461.6, we need not decide whether those hours should also have been excluded under Government Code section 31461.

III. Disposition

The judgment is affirmed.
Simons, J., and Needham, J., concurred.
NOTES
[1]  For the remainder of this opinion, unless more specificity is needed, we will refer to MCERA and its Board collectively as MCERA.
[2]  Intervener County of Marin has filed a notice under California Rules of Court, rule 8.200(a)(5) that it joins and adopts the arguments made in MCERA's briefs. Accordingly, unless otherwise indicated, references to MCERA will also include the County of Marin.
[3]  Government Code section 31461 states, in part: "`Compensation earnable' by a member means the average compensation as determined by the board, for the period under consideration upon the basis of the average number of days ordinarily worked by persons in the same grade or class of positions during the period, and at the same rate of pay."
