The electronic structures and excitation properties of dye sensitizers determine the photon-to-current conversion efficiency of dye sensitized solar cells (DSSCs). In order to understand the different performance of porphyrin dye sensitizers YD2 and YD2-o-C8 in DSSC, their geometries and electronic structures have been studied using density functional theory (DFT), and the electronic absorption properties have been investigated via time-dependent DFT (TDDFT) with polarizable continuum model for solvent effects. The geometrical parameters indicate that YD2 and YD2-o-C8 have similar conjugate length and charge transfer (CT) distance. According to the experimental spectra, the HSE06 functional in TDDFT is the most suitable functional for describing the Q and B absorption bands of porphyrins. The transition configurations and molecular orbital analysis suggest that the diarylamino groups are major chromophores for effective CT excitations (ECTE), and therefore act as electron donor in photon-induced electron injection in DSSCs. The analysis of excited states properties and the free energy changes for electron injection support that the better performance of YD2-o-C8 in DSSCs result from the more excited states with ECTE character and the larger absolute value of free energy change for electron injection.