Suppose I get on a train/tram/whatever at time = 0, my ticket is valid until time = 1 and my journey ends at time = 2. Should I be fined or is this okay?
When your ticket expires, you become a hare exactly at that spot. It does not matter that the ticket was valid when you boarded. Buy another ticket from the driver, SBB app on your mobile phone, or, if the service is frequent, pause the journey and buy at stop.
They will fine you also if the ticket is formally valid right now but will expire before reaching the next scheduled stop (unless so happens just because the service is significantly delayed).
The validity period is printed on the ticket. Return tickets are often valid for 24 hours but one way tickets usually for much less. Here is the example of the ticket that was valid from 16:24 (moment of the purchase) till 17:24 on the 24th of September (09), 2020:
Look for the similarly printed time stamps on your ticket. The German word for this is Gültig - valid.
. Should I be fined or is this okay?
Depends on when you present your ticket. The 24 hour ticket's validity starts when you first stamp it and it's validity ends 24 hours after the stamped date and time. When you show the ticket to a conductor it's either valid or not and the only thing that the conductor can look at is the time stamp on the ticket. If the ticket is valid, you are fine. If it's invalid the conductor can fine you, although you may be able to sweet talk your way out of it it it's really just a few minutes.
The time when you entered the train/bus doesn't matter. 24-hour tickets don't really have a concept of a "trip". You can ride on the bus or on the tram in circles as long as you like.
It's actually the same as with any other ticket. They expire a certain time after they have been stamped and if you are still in the train/bus after that time, you are riding illegally.
In the Zurich public transit regulations that someone else linked to, the only section I can see that would extend validity beyond the time printed is this:
Compound tickets are valid until the last scheduled stop that can be reached before the end of the validity period. If a journey with a combined ticket valid for up to two hours cannot be made directly and uninterruptedly within the period of validity according to the timetable, the journey can be continued to the destination. This also applies to connecting tickets that were purchased for a travel association ticket. In this case, detours, reverse journeys and interruptions of travel not due to the timetable are excluded.
This provision is also applicable to a travelcard which has been validated for a direct journey outside of the network area and therefore expires earlier. As proof, all tickets used for the journey must be presented at an inspection.
Other than this, the rules are very clear that validity is based on time.
If you're in the middle of a journey and your ticket expires, you're travelling without a valid ticket, even if you're only a couple of minutes away from your stop. You didn't ask whether you're likely to get caught, but whether you could be fined. The answer is yes, you could be fined for this.
Check out the official regulations in German. Relevant sections start at 3.8, more specifically 3.8.8. The ticket is valid up to the last stop which is reached before the validity expires, unless the trip for which the ticket is supposed to be valid takes longer than the validity period of the ticket according to the timetable.
- If the service is delayed or disrupted, in general you can expect tolerance.
- When the validity period is given in days, not hours, then the ticket is valid until 5 in the morning of the following day (night surcharges may apply). This does not apply to the 24 hour ticket, where the validity period is given in hours.
- Tickets bought after the train/bus/tram departed aren't valid. But you can expect leniency if it's clear you bought the ticket before the ticket controller came into view.