
71 Cal.App.2d 455 (1945)
JOHN M. BROPHY, Appellant,
v.
EMPLOYEES RETIREMENT SYSTEM et al., Respondents.
Civ. No. 12855. 
California Court of Appeals. First Dist., Div. One.  
Oct. 31, 1945.
 Joseph T. Curley and Marvin C. Hix for Appellant.
 John J. O'Toole, City Attorney, and Norman Sanford Wolff, Deputy City Attorney, for Respondents. *457
 PETERS, P. J.
 Plaintiff, a retired fireman, appeals from a declaratory judgment fixing his retirement rights under the provisions of the San Francisco Charter. The action, except for one minor point, was tried upon stipulated facts.
 Plaintiff was appointed to the civil service position of fireman in October, 1909, under the then provisions of the charter. In December, 1925, he was appointed captain, which position he held until his retirement in May, 1942. At the time of his retirement his salary was $250 a month. On July 1, 1944, the salary for the rank of captain was increased to $300. Judgment in this action was filed August 15, 1944.
 In 1909 the city charter provided that a fireman, after 25 years of active service, could retire on a monthly retirement allowance equal to one-half the amount of salary attached to the rank held by him for three years prior to retirement. In 1932 a new charter was adopted. It contained a provision similar to the above 1909 provision but added an entirely new provision, section 163 (now numbered  163b) reading as follows: "Should any retired person, except persons retired for service prior to January 8, 1932, ... engage in a gainful occupation prior to attaining the age of sixty-two, the retirement board shall reduce that part of his monthly pension or retirement allowance which is provided by contributions of the city and county to an amount which, when added to the amount earned monthly by him in such occupation shall not exceed the compensation on the basis of which his pension or retirement allowance was determined." So far as firemen are concerned the city has made all the contributions to pay the retirement allowances. Plaintiff has made no contributions for that purpose.
 After judgment was entered, the above-quoted section was amended. This amendment became effective in January, 1945. It provides: "The provisions of paragraph (b) of this section shall be inoperative during the existing war between the United States and the axis powers, and for six (6) months after the termination of said war."
 It is stipulated that in June of 1942 plaintiff, then under the age of 62 and not disabled, accepted gainful employment. Since that date the retirement board has paid him as his retirement allowance the difference between the amount he so earned and the amount he would have earned in the fire department had he not retired. This has resulted in materially reducing his retirement allowance from a maximum of $125 *458 a month to as low as $8.08 a month. Plaintiff thereupon instituted this action for declaratory relief to determine whether section 163 is applicable to him. The trial court held that this section was applicable to plaintiff, and that, so long as plaintiff remains gainfully employed and earns more than one-half of $250 per month, the retirement board is required to pay him a retirement allowance equal to the difference between the amount of his monthly earnings and $250. From this judgment plaintiff appeals.
 Plaintiff asserts that the 1909 civil service retirement provisions, under which he was first employed, constituted a contract for wages for services rendered, and that the 1932 amendment has no application to him; that to apply the 1932 amendment to him would be to impair the obligation of his contract with the city and interfere with his vested rights. It is next asserted that even if section 163 is applicable to plaintiff, inasmuch as in 1932 when that amendment was adopted plaintiff had worked under the 1909 provision for 22 years, he had earned 22/25 of his retirement allowance, and his right had vested as to that proportion of it. Neither contention can be sustained.
 [1] It must be conceded that there has been some confusion in the California cases as to the exact legal status of public employees' pensions. The majority of states hold that such pensions are gratuities that can be modified or terminated at the will of the donor. (See cases collected and commented upon, 54 A.L.R. 943; 98 A.L.R. 505; 112 A.L.R. 1009; 137 A.L.R. 249.) Although there are a few early cases in California holding that a pension is a gratuity, if that rule were now followed it would mean that pension laws would be invalid, being in violation of article IV, section 31, of the Constitution prohibiting gifts by government to any individual. To obviate this difficulty it is now well-settled in this state that pension provisions do not provide for a gratuity but "become a part of the contemplated compensation for those services and so in a sense a part of the contract of employment itself" (O'Dea v. Cook, 176 Cal. 659, 661 [169 P. 366]), and that "the right to a pension becomes a vested one upon acceptance of employment by an applicant." (Dryden v. Board of Pension Commrs., 6 Cal.2d 575, 579 [59 P.2d 104]; see, also, Riggs v. District Retirement Board, 21 Cal.2d 382 [132 P.2d 1]; Aitken v. Roche, 48 Cal.App. 753 [192 P. 464]; Snyder v. City of Alameda, 58 Cal.App.2d 517 [136 P.2d 857]; Groat v. Walkup Drayage etc. Co., 14 Cal.App.2d 350 *459 [58 P.2d 200].) [2] However, the determination that a pension right becomes a part of the contract of employment and is a vested right, does not settle the question as to when the right vests and what the extent of this vested right may be. It is now too well-settled to require extended discussion that the right to a pension does not become vested until the happening of the contingency upon which the pension becomes payable, usually retirement for disability or length of service. (McCarthy v. City of Oakland, 60 Cal.App.2d 546 [141 P.2d 4]; Risley v. Board of Civil Service Commrs., 60 Cal.App.2d 32 [140 P.2d 167]; Brooks v. Pension Board, 30 Cal.App.2d 118 [85 P.2d 956]; Pennie v. Reis, 80 Cal. 266 [22 P. 176]; Klench v. Board of Pension Fd. Commrs., 79 Cal.App. 171 [249 P. 46]; Jordan v. Retirement Board, 35 Cal.App.2d 653 [96 P.2d 973]; Sweesy v. Los Angeles etc. Retirement Bd., 17 Cal.2d 356 [110 P.2d 37].) [3] But even though the right becomes vested upon the happening of the contingency, the right so accruing is not to any fixed and certain sum, it being the law that the amount of the pension may be increased or decreased after retirement in accordance with the salary of the rank held by the pensioner at the time of his retirement. (McCarthy v. City of Oakland, 60 Cal.App.2d 546 [141 P.2d 4]; Brooks v. Pension Board, 30 Cal.App.2d 118 [85 P.2d 956]; Carr v. Fire Commission, 30 Cal.App.2d 208 [85 P.2d 959]; Jordan v. Retirement Board, 35 Cal.App.2d 653 [96 P.2d 973]; Murphy v. City of Piedmont, 17 Cal.App.2d 569 [62 P.2d 614, 64 P.2d 399]; Casserly v. City of Oakland, 6 Cal.2d 64 [56 P.2d 237].) [4] In view of these cases the contention that the right and the extent of the right of appellant became fixed and vested before 1932 is without merit. It must be held that plaintiff's right to a pension did not become vested until May of 1942 when he retired, and hence, that the 1932 amendment to the charter adding section 163 thereto is applicable to him. This conclusion also answers plaintiff's contention that his right to 22/25 of the pension became vested prior to the 1932 amendment. The right is not thus severable. The right did not become vested in 1932 but became vested in May of 1942 when the contingency upon which the vesting depended--i.e., retirement--occurred.
 [5] Plaintiff next contends that the 1945 amendment providing that section 163b (1932,  163) "shall be inoperative during the existing war" is retroactive to December 7, 1941. While this charter provision was not adopted until after judgment *460 was entered herein it would seem quite clear that this appeal should be decided in the light of the statutory law as it now exists and not as it existed when judgment was entered. This is an action for declaratory relief. The action was brought to settle the rights of this plaintiff to his pension. The decree, by its very nature, acts on the rights of these parties in the future as well as in the past. For that reason the law in effect when the appellate court renders its opinion must be applied. (Tulare Irr. Dist. v. Lindsay-Strathmore Irr. Dist., 3 Cal.2d 489, 526 [45 P.2d 972, 1014].)
 [6] The contention that the 1945 amendment should be given retroactive effect is unsound. It is elementary law that all statutes are interpreted to operate prospectively unless their language clearly compels an interpretation that they were intended to operate retroactively. (See Chaney v. Los Angeles County Retirement Bd., 59 Cal.App.2d 413 [138 P.2d 735], and Holmberg v. City of Oakland, 55 Cal.App. 270 [203 P. 167], applying this rule to pension statutes.) There is no such compelling language here. While the word "during" is susceptible of the interpretation that the amendment should apply throughout the period of the war, it is far more reasonable, particularly when the future tense "shall be" immediately precedes it, to interpret the word as only including the period of the war from the date of the statute to six months after the end of the war. In Holmberg v. City of Oakland, 55 Cal.App. 270, 271 [203 P. 167], a charter provision that a police officer injured in the performance of his duty "shall be entitled to receive ... such medical ... treatment ... as may be required during the continuance of his disability ..." was held not retroactive and therefore not applicable to an officer disabled by injuries sustained prior to the effective date of the charter provision.
 [7] There is another reason why this section should not be construed to operate retroactively, and that is that so to construe it would probably result in declaring it unconstitutional. As already held, plaintiff's right became vested in May of 1942 when he retired. Each month the extent of that right became fixed. Although the city could raise or lower the amount of the pension in the future by changing the salary of captain, they could not lawfully raise or lower the retirement allowance that had already accrued. After plaintiff started to work in June of 1942 the right that accrued each month thereafter was no longer $125 per month, but varied from $8.08 per month to $88.72 per month. If the city, after *461 plaintiff's right to such amounts became fixed, attempted, retroactively, to pay plaintiff the difference between these smaller amounts and $125 per month, it would constitute a clear gift of public funds in violation of the constitutional provision.
 [8a] Plaintiff also argues that section 163 (now  163b) is a general law which does not operate uniformly, and is therefore invalid under article I, section II, of the Constitution. In this connection it is pointed out that the section operates to reduce the part of the pension provided by the contributions of the city and county to those retired employees who are under 62 years of age, and whose income, over a certain amount, is derived from gainful employment. It does not affect those over 62, those who were under 62 but retired for disability received in the course of their employment, or those under 62 whose income is not derived from gainful employment. Plaintiff argues that this classification is arbitrary and unreasonable, and, for that reason, invalid. With this contention we cannot agree. [9] The presumption is that the legislative body acted properly, and unless the classification is clearly arbitrary, the legislation must be sustained. A court will not and should not set aside a statutory provision unless the classification is palpably arbitrary. (See cases collected 5 Cal.Jur., p. 832,  193.) [8b] The section was obviously passed to make retirement less attractive to those under 62. Retirement was to be permitted after 25 years of service, but restrain men to a limited extent from retiring in their forties and fifties it was provided that if they did so they could not engage in lucrative employment without having their allowance proportionally reduced. Apparently, those who drafted the charter felt that no such limitation should be placed on those over 62, it apparently being felt that it was not in the public interest to induce men of that age or older to remain in the service. A similar obvious distinction exists between those who retire for a service incurred disability and those who do not. Thus, it is perfectly clear that the classification between those over and those under 62, and between those who retire for service disability and those who are not disabled, is based upon a reasonable and sound distinction.
 The reason for distinguishing between those under 62 who retire and who then take another job, and those under 62 who retire and receive an independent income, is not so clear. It perhaps was felt that it would be too difficult to enforce *462 the rule against those who had an independent income because of the difficulty of securing information, while in the case of most gainfully employed persons that is a relatively easy matter. Perhaps it was found that the number of retired firemen who had independent incomes was too small to affect the purpose desired. Perhaps it was felt that in discouraging retirements of the able-bodied under 62 the purpose could be accomplished without extending the rule to the few firemen who might have independent incomes. In view of the presumptions that the classification is reasonable and that the Legislature acted properly, we cannot hold, as a matter of law, that the classification is so arbitrary that it renders the whole section unconstitutional. The case of Mansur v. City of Sacramento, 39 Cal.App.2d 426 [103 P.2d 221], relied upon by plaintiff, is not in point. In that case the trial court held, and the appellate court affirmed the holding, that a charter provision providing that where one spouse was employed by any governmental agency supported by tax revenues the other was not eligible to a civil service appointment in Sacramento was arbitrary and invalid. There was no basis for the classification there involved and the trial court so held. Here the classification has been upheld by the trial court and there appears to be support for its determination. For that reason the determination of the trial court must be affirmed.
 [10] Plaintiff's final contention is that the judgment was erroneous in declaring that under section 163 the board "was and is required ... [to reduce plaintiff's pension] ... to an amount which, when added to the amount earned monthly by John M. Brophy in his outside gainful occupation, shall not exceed $250 per month, which was the compensation on the basis of which John M. Brophy's pension or retirement allowance was determined. ..." Respondents concede that the amount of the pension is not based on a fixed salary of $250, but may vary as the salary attached to the rank of captain increases or decreases. In fact, some six weeks before judgment was entered, the salary of a captain was increased to $300.
 The judgment is obviously too limited. This was an action for declaratory relief. Among other things plaintiff prayed "that it be declared and determined that plaintiff is entitled to a pension equal to one-half of the compensation attached to the rank of Captain. ..." The action was instituted to secure a determination of plaintiff's pension rights not only *463 as to the past but also as to the future. As already pointed out in another connection, the judgment necessarily affects the rights of the parties in the future as well as in the past. In an action for declaratory relief the trial court is empowered to make a binding declaration of the rights and duties of the parties and such declaration has the force of a final judgment. (Code Civ. Proc.,  1060.) The judgment as entered declares that the board "is required" to fix plaintiff's retirement allowance on a fixed salary of $250 per month, which is not the fact, the allowance admittedly being based on whatever salary is fixed for the rank of captain for the particular month in question. The findings and judgment are modified to so provide. As so modified, the judgment is affirmed, respondents to recover costs.
 Ward, J., and Schottky, J. pro tem., concurred.
