For a photon traveling in a vacuum, it is correct to say that time does not pass from the photon's perspective. This is because, according to special relativity, as an object approaches the speed of light (c), time dilation occurs, and the passage of time slows down for that object relative to an observer at rest.
However, when a photon travels through a medium, such as a transparent material like glass or water, the situation is slightly different. In a medium, photons interact with the atoms or molecules present, and their speed is slower than c due to scattering and absorption processes. This reduction in speed affects the way time is experienced for the photon.
From the perspective of the photon, its travel through the medium is still instantaneous. This means that, in a sense, time does not elapse for the photon during its journey through the medium. The photon is absorbed by the atoms or molecules of the medium and then re-emitted, but this process is instantaneous from the photon's frame of reference.
However, from an observer's perspective, who is not moving at the speed of light, time does pass during the photon's interaction with the medium. The absorption and re-emission processes of the photons take a measurable amount of time in the observer's frame of reference.
In summary, while a photon itself does not experience the passage of time, when it travels through a medium, its interactions with the medium can be observed to have a finite duration by an external observer.