The time within which an act is to be done as provided in this code or in any order issued pursuant to any ordinance, when expressed in days, shall be computed by excluding the first day and including the last, except that if the last day is a Saturday, Sunday or holiday it shall be excluded; and when the time is expressed in hours, the whole of Saturday, Sunday or a holiday, from midnight to midnight, shall be excluded.