
29 Cal.App.3d 135 (1972)
105 Cal. Rptr. 268
THE PEOPLE, Petitioner,
v.
THE SUPERIOR COURT OF SANTA CLARA COUNTY, Respondent; RICHARD ALLEN SANDOVAL et al., Real Parties in Interest.
Docket No. 32031.
Court of Appeals of California, First District, Division Four.
December 5, 1972.
*136 COUNSEL
Evelle J. Younger, Attorney General, Edward A. Hinz, Jr., Chief Assistant Attorney General, Doris H. Maier, Assistant Attorney General, Derald E. Granberg, Robert R. Granucci and Herbert F. Wilkinson, Deputy Attorneys General, for Petitioner.
Joseph P. Busch, District Attorney (Los Angeles), Harry B. Sondheim and Donald J. Kaplan, Deputy District Attorneys, as Amici Curiae on behalf of Petitioner.
No appearance for Respondent.
*137 Sheldon Portman, Public Defender, George Thacher, Deputy Public Defender, Harry J. Delizonna, Philip H. Pennypacker and John C. Schaller for Real Parties in Interest.
OPINION
BRAY, J.[*]
The People of the State of California petition for writ of mandate to set aside the order of the Santa Clara County Superior Court to suppress evidence.

Question Presented
Was the petition filed in time? No.

Record
Real parties in interest were charged in the municipal court with violation of Health and Safety Code section 11912. Real party Martinez was also charged with violation of section 11530. After a preliminary examination all three were held to answer in the superior court. On June 16, 1972, an information was filed in the Santa Clara County Superior Court charging them with the above stated offenses. On August 14, the date originally set for trial, their motion to suppress evidence pursuant to Penal Code section 1538.5 was granted.[1] The court on the same day reassigned the case for trial to the master calendar "to trail" on August 21. On that date it was set "to trail" on September 11. On that date it was continued to a later date. On September 13, the People filed this petition for writ of mandate.
(1) The petition for writ of mandate was filed too late. Section 1538.5 of the Penal Code provides, in pertinent part: "(o) Within 30 days after a defendant's motion is granted at a special hearing in the superior court, the people may file a petition for writ of mandate or prohibition, seeking appellate review of the ruling regarding the search or seizure motion. If the trial of a criminal case is set for a date which is less than 30 days from the granting of a defendant's motion at a special hearing in the superior court, the people, if they have not filed such a petition and wish to preserve their right to file such a petition, shall file in the superior court on or before *138 the trial date or within 10 days after the special hearing, whichever occurs last, a notice of intention to file such a petition and shall serve a copy of the notice upon the defendant."
Although this section seems at first to be confusing, an analysis of it shows what it means:
1. Where the date set for trial is more than 30 days away from the date on which the motion to suppress is granted, the People have 30 days from the date of the granting to file a petition.
2. Where the date set for trial is less than 30 days away from the date on which the motion to suppress is granted, the People may file a petition before the date set for trial.
3. Where the date set for trial is less than 30 days away from the date on which the motion to suppress is granted, and the People wish to preserve their right to file a petition within the 30-day limit, they must file a notice of their intention to so file within 10 days from the date of the granting; or if the date set for trial is less than 10 days from the date of the granting, they must file a notice of their intention to file on or before the date set for the trial.
Applying the section to this case the situation is as follows: The motion to suppress was granted August 14. The case was set for trial for August 21 (seven days away) "to trail." This meant that the case would go to trial on that date unless there was no criminal department available in which event it would be tried as soon as a department would become available. The People's remedy here was either within seven days to apply to the appellate court for a writ, or to give a notice of intention to file such petition. The People failed to do either, as they waited until the 30th day after the granting of the motion to file this petition. Had the case been tried on the date set, August 21, or within a few days thereafter as is the practice where a case "trails," it would have been too late for the People to have applied for a writ.
It is true that Penal Code section 1538.5 provides that where a motion to suppress is granted and the case is set for trial within 30 days thereafter, the People, if they desire 30 days in which to file for the writ, must file a notice of intention to apply for such writ "on or before the trial date or within 10 days after the special hearing, whichever occurs last." Obviously, where the case is set for trial within 10 days of the granting of the motion to suppress, as was the situation here, in order to make the section workable the People must apply for the writ on or before the date set for trial or obtain a stay.
*139 (2) As said in Nerell v. Superior Court (1971) 20 Cal. App.3d 593, 597 [97 Cal. Rptr. 702] (overruled on another point, 6 Cal.3d 484, 489 [99 Cal. Rptr. 630, 492 P.2d 686]), "The purpose of section 1538.5 of the Penal Code is to determine, in advance of trial if possible, the legal and factual issues governing the admissibility of evidence gained as a result of a search." This would not be possible if a literal application of the 10-day provision were made where the case is set for trial within that time.
The factor which sets the time provisions of the section in motion is the time for which the trial is set after the granting of the motion to suppress, even though the trial may not be held on that date.
(3) The time limits set by Penal Code section 1538.5 are jurisdictional (see Gomes v. Superior Court (1969) 272 Cal. App.2d 702, 704 [77 Cal. Rptr. 539]; see also Eiseman v. Superior Court (1971) 21 Cal. App.3d 342 [98 Cal. Rptr. 342]).
Petition denied. The alternative writ of mandate is discharged.
Devine, P.J., and Rattigan, J., concurred.
A petition for a rehearing was denied January 3, 1973, and petitioner's application for a hearing by the Supreme Court was denied February 22, 1973.
NOTES
[*]   Retired Presiding Justice of the Court of Appeal sitting under assignment by the Chairman of the Judicial Council.
[1]  On August 17, the People filed notice of appeal from the order granting the motion to suppress. The purported appeal was dismissed by this court on September 22, as the order was not an appealable order.
