The second harmonic generation (SHG) intensity spectrum of SiC, ZnO, GaN two-dimensional hexagonal crystals is calculated by using a real-time first-principles approach based on Green's function theory [Attaccalite et al., Phys. Rev. B: Condens. Matter Mater. Phys. 2013 88, 235113]. This approach allows one to go beyond the independent particle description used in standard first-principles nonlinear optics calculations by including quasiparticle corrections (by means of the GW approximation), crystal local field effects and excitonic effects. Our results show that the SHG spectra obtained using the latter approach differ significantly from their independent particle counterparts. In particular they show strong excitonic resonances at which the SHG intensity is about two times stronger than within the independent particle approximation. All the systems studied (whose stabilities have been predicted theoretically) are transparent and at the same time exhibit a remarkable SHG intensity in the range of frequencies at which Ti:sapphire and Nd:YAG lasers operate; thus they can be of interest for nanoscale nonlinear frequency conversion devices. Specifically the SHG intensity at 800 nm (1.55 eV) ranges from about 40-80 pm V(-1) in ZnO and GaN to 0.6 nm V(-1) in SiC. The latter value in particular is 1 order of magnitude larger than values in standard nonlinear crystals.