Time-dependent density-functional theory (TDDFT) is widely used for calculating electron excitations in clusters and large molecules. For optical excitations, TDDFT is customarily applied in two distinct approaches: transition-based linear-response TDDFT (LR-TDDFT) and the real-time formalism (RT-TDDFT). The former directly provides the energies and transition densities of the excitations, but it requires the calculation of a large number of empty electron states, which makes it cumbersome for large systems. By contrast, RT-TDDFT circumvents the evaluation of empty orbitals, which is especially advantageous when dealing with large systems. A drawback of the procedure is that information about the nature of individual spectral features is no...