The phase diagram of quantum chromodynamics (QCD) and its associated thermodynamic properties of quark-gluon plasma (QGP) are studied in the presence of time-dependent magnetic field. The study plays a pivotal role in the field of cosmology, astrophysics, and heavy-ion collisions. In order to explore the structure of quark-gluon plasma to deal with the dynamics of quarks and gluons, we investigate the equation of state (EoS) not only in the environment of static magnetic field but also in the presence of time-varying magnetic fields. So, for determining the equation of state of QGP at nonzero magnetic fields, we revisited our earlier model where the effect of time-varying magnetic field was not taken into consideration. Using the phenomenological model, some appealing features are noticed depending upon the three different scales: effective mass of quark, temperature, and time-independent and time-dependent magnetic fields. Earlier the effective mass of quark was incorporated in our calculations, and in the current work, it is modified for static and time-varying magnetic fields. Thermodynamic observables including pressure, energy density, and entropy are calculated for a wide range of temperature- and time-dependent as well as time-independent magnetic fields. Finally, we claim that the EoS are highly affected in the presence of a magnetic field. Our results are notable compared to other approaches and found to be advantageous for the measurement of QGP equation of state. These crucial findings with and without time-varying magnetic field could have phenomenological implications in various sectors of high-energy physics.