
60 Cal.2d 822 (1964)
In re ROBERT ESPINOZA RODRIGUEZ on Habeas Corpus.
Crim. No. 7579. 
Supreme Court of California. In Bank.  
Feb. 6, 1964.
 F. Morton Cameron and S. A. Foushee, under appointment by the Supreme Court, and Cameron & Foushee for Petitioner.
 Stanley Mosk, Attorney General, William E. James, Assistant Attorney General, and Gordon Ringer, Deputy Attorney General, for Respondent.
 SCHAUER, J.
 This matter is before us on an order to show cause issued by the District Court of Appeal upon an application for habeas corpus filed in propria persona by Robert Espinoza Rodriguez, who is confined in the California Rehabilitation Center for treatment as a narcotics addict by order of the superior court entered pursuant to article 3, chapter 11, title 7, of part III of the Penal Code ( 6500-6510, which deal with commitment to that facility of "persons not charged with a crime").petitioner is represented in these proceedings by appointed counsel.
 [1] As the sole ground of asserted illegality of his confinement petitioner cites In re Raner (1963) 59 Cal.2d 635, 637 [1] - 641 [5] [30 Cal.Rptr. 814, 381 P.2d 638], and contends that a court order under which he was detained pending his commitment hearing was unlawful because the physician's examination upon which such order was based was not conducted "within three days prior to the filing of the petition [for commitment]," as required by Penal Code section 6502. We have concluded that this contention is without merit, that no invalidity is shown in petitioner's commitment proceedings, and hence that the relief prayed for should be denied.
 The facts are undisputed. While entering San Diego County at the international border petitioner was observed by police officers to be apparently under the influence of narcotics. With petitioner's consent he was checked for indications of recent narcotics usage, and the officers found numerous needle marks on the lower portion of both legs as well as numerous surface cuts on his right forearm.petitioner was thereupon arrested and booked on charges of violating Health and Safety Code sections 11500 and 11721. The arrest took place at 8 p.m. on September 20, 1962. At 9:05 o'clock on the same evening petitioner was examined in the jail dispensary *824 by Dr. Robert L. Williams, a police physician, who found that the pupils of petitioner's eyes were constricted and reacted very poorly to light, that there were 19 needle marks in the vein of the inner aspect of petitioner's left lower leg and 20 needle marks in the corresponding vein of his right lower leg, and that there were "Questionable areas" on both of petitioner's arms. Dr. Williams determined that the needle marks in petitioner's legs varied "from fresh (within a few hours) to 7 to 10 days old," concluded that petitioner was a "Heroin addict, now under the influence" of narcotics, and wrote out a report reciting such findings and conclusion. The next day (September 21) the charges against petitioner of violating Health and Safety Code sections 11500 and 11721 were formally dropped, and Dr. Williams prepared and signed the affidavit required by Penal Code section 6502. In that affidavit he set forth the findings of his examination of the previous night and concluded that petitioner is addicted to the use of narcotics and "unless confined is likely to bring about injury to himself or others or become a menace to the public."
 September 21, 1962, was a Friday. On the following Monday (September 24) proceedings under Penal Code section 6500 were begun: a petition for commitment as a narcotics addict was filed by the district attorney in the superior court, together with Dr. Williams' affidavit of September 21. The court forthwith made an order for petitioner's detention pending hearing, finding that "said person is sufficiently addicted to the use of Narcotic Drugs that he is likly [sic] to injure himself or others if not immediately hospitalized or detained."petitioner appeared in court and was informed of his legal rights, and an order was made fixing the times and places of petitioner's medical examination and of his commitment hearing. The latter were duly held, and petitioner was found to be a narcotics addict within the meaning of Penal Code section 6500 and was committed to the custody of the Director of Corrections for treatment.petitioner thereupon demanded a jury trial (Pen. Code,  6508); such trial resulted in a unanimous verdict that petitioner was addicted to the use of narcotics, and petitioner was again committed to the custody of the Director of Corrections.
 Penal Code section 6502 provides in relevant part that "The court may ... order that the person [sought to be committed] be confined pending hearing in a county hospital or other suitable institution if the petition [for commitment] is accompanied by the affidavit of a physician alleging that *825 he has examined such person within three days prior to the filing of the petition and has concluded that, unless confined, such person is likely to injure himself or others or become a menace to the public." (Italics added.) The issue presented is whether the petition for commitment filed in the case at bench was accompanied by a timely physician's affidavit within the meaning of Penal Code section 6502. In In re Raner (1963) supra, 59 Cal.2d 635, 639 [4], we held that jurisdiction to enter an order of commitment depends on strict compliance with each of the specific statutory prerequisites for maintenance of the proceeding. Here, in the light of the applicable statutory law, such compliance is apparent on the face of the record. Dr. Williams' affidavit was based on his examination of petitioner on the evening of September 20, which was a Thursday. Accordingly, if holidays were to be included in counting the time under Penal Code section 6502, the three-day period within which the district attorney could have filed that affidavit (and a petition for commitment) and obtained a pre-hearing detention order based on the findings and conclusion recited therein would have expired on Sunday, September 23. But the relevant code section governing computation of time provides that "If the last day for the performance of any act provided or required by law to be performed within a specified period of time shall be a holiday, then such period is hereby extended to and including the next day which is not a holiday. ..."
 "This section applies [to named provisions of the code] ... and to all other provisions of law, however stated or wherever expressed, providing or requiring an act to be performed on a particular day or within a specified period of time." (Code Civ. Proc.,  12a; see also Code Civ. Proc.,  12; Civ. Code,  10; Gov. Code,  6800; Alford v. Industrial Acc. Com. (1946) 28 Cal.2d 198, 200 [1] [169 P.2d 641], and cases there cited.) Sunday is such a holiday (Code Civ. Proc.,  10; Civ. Code,  7; Gov. Code,  6700), and hence the three-day period in question was extended by operation of law to and including Monday, September 24--the day on which these documents were in fact filed and the pre-hearing detention order was made.
 Counsel for petitioner contends, however, that this case is not governed by the just quoted code rule. But "The gravest considerations of public order and security require that the method of computing time be definite and certain. Before a given case will be deemed to come under an exception to *826 the general rule the intention must be clearly expressed that a different method of computation was provided for." (Ley v. Dominguez (1931) 212 Cal. 587, 594-595 [2] [299 P. 713]; accord, Reichardt v. Reichardt (1960) 186 Cal.App.2d 808, 809-810 [1] [9 Cal.Rptr. 225].) Here no such intention appears. It is urged that Penal Code section 6502 be construed as analogous to statutes (e.g., Elec. Code,  22840) providing that a certain act (e.g., the filing of nominating papers for an election) be done "not less than" or "not later than" a fixed number of days before the happening of a specified event (e.g., the holding of the election). In the latter circumstance it has been held that to allow that act to be performed one day later because the final day was a holiday "would be in manifest disregard of the provisions of the statute" as thus worded. (Griffin v. Dingley (1896) 114 Cal. 481, 483 [46 P. 457]; accord, Steele v. Bartlett (1941) 18 Cal.2d 573, 574 [1] [116 P.2d 780]; Hutchins v. County Clerk (1934) 140 Cal.App. 348, 349 [1, 2] [35 P.2d 563].) But such statutes and cases are clearly distinguishable, for in section 6502 it is required that the examination have taken place "within" three days of the filing of the petition for commitment, rather than "not later than" three days prior to such filing. As correctly observed in Hutchins v. County Clerk (1934) supra, at p. 349 [2] of 140 Cal.App., "there is a difference in law between the meaning of the words 'within' and 'prior.' " The practical reason for this difference is at once apparent: in the Griffin and Steele situations, the date which is the basis for the computation (e.g., the date of the election) is fixed in advance, so that any person seeking to comply with the statute can count backwards from that date and thus determine the last day on which the act (e.g., the filing of nominating papers) may be performed; but under the statutes here relevant the petition for commitment may be filed at any time (or not be filed at all), and one cannot count backwards from an unfixed date. Thus although the subject language of Penal Code section 6502 appears to read retrospectively, in practical effect it tends to operate prospectively and authorizes a prehearing detention order only if the physician's affidavit and the petition for commitment are filed within three days after the examination referred to therein. It follows that section 6502 is governed by the above quoted code rule for computing time, and that the physician's affidavit in the case at bench was timely.
 [2] The clear purpose of this portion of section 6502, moreover, is to allow a suspected addict to retain his liberty *827 pending hearing if the physician's examination should disclose that he is neither likely to "bring about injury to himself or others" nor "become a menace to the public." That purpose would be frustrated if the district attorney were to delay the physician's examination until just before the filing of the petition for commitment. On the contrary, such examination at the earliest possible moment should be encouraged, and the law enforcement officials in the case at bench are therefore to be commended for their promptness in causing petitioner to be examined by a physician in spite of the lateness of the hour that he was taken into custody.
 The order to show cause is discharged and the petition for habeas corpus is denied.
 Gibson, C. J., Traynor, J., McComb, J., Peters, J., Tobriner, J., and Peek, J., concurred.
