The evolution of a stellar disk under the influence of viscous evolution , photoevaporation from the central source , and photoevaporation by external stars is studied . We take the typical parameters of TTSs and the Trapezium Cluster conditions . The photoionizing flux from the central source is assumed to arise both from the quiescent star and accretion shocks at the base of stellar magnetospheric columns , along which material from the disk accretes . The accretion flux is calculated self-consistently from the accretion mass loss rate . We find that the disk can not be entirely removed using only viscous evolution and photoionization from the disk-star accretion shock . However , when FUV photoevaporation by external massive stars is included the disk is removed in 10 ^ { 6 } -10 ^ { 7 } yr ; and when EUV photoevaporation by external massive stars is included the disk is removed in 10 ^ { 5 } -10 ^ { 6 } yr . An intriguing feature of photoevaporation by the central star is the formation of a gap in the disk at late stages of the disk evolution . As the gap starts forming , viscous spreading and photoevaporation work in resonance . When viscous accretion and photoevaporation by the central star and external massive stars are considered , the disk shrinks and is truncated at the gravitational radius , where it is quickly removed by the combination of viscous accretion , viscous spreading , photoevaporation from the central source , and photoevaporation by the external stars . There is no gap formation for disks nearby external massive stars because the outer annuli are quickly removed by the dominant EUV flux . On the other hand , at larger , more typical distances ( d \gg 0.03 pc ) from the external stars the flux is FUV dominated . As a consequence , the disk is efficiently evaporated at two different locations ; forming a gap during the last stages of the disk evolution .