We have studied both theoretically and experimentally flux-creep dynamics in superconductors. A theoretical analysis of nonlinear flux diffusion shows that the relaxation of the electric field proves to be similar for different models of thermally activated flux creep, whereas the long-time decay of the magnetic moment M(t) can be essentially model dependent. A proposed scaling analysis indicates that the short-time decay of M(t) in the subcritical region j < j(c) is universal and consists of two stages. The initial nonlogarithmic stage is due to a transient redistribution of magnetic flux over the sample cross section, the duration of this stage tau0 being entirely determined by macroscopic quantities, such as sample sizes,flux creep rate M1(T,B) = dM/d lnt, and magnetic ramp rate B(e) = dB/dt. The seconds stage corresponds to the approximately logarithmic relaxation M(t) = M(c) - M1ln(t/t0), with t0 being a macroscopic time constant that also depends on sample sizes, M1(T,B), and the voltage criterion E(c) at which the critical current density j(c) is defined. We consider different models of flux dynamics with nonlinear flux-creep-activation barriers U(j) and obtain explicit formulas for tau0 and t0 for the exponential V-I curve and the vortex-glass model. We have also performed an experimental study of magnetic relaxation in grain-oriented YBa2Cu3O7 in which the time constant tau0 has been measured directly at different temperatures 4.2 K < T < 88 K, magnetic fields 0 < B < 8 T, and ramp rates 5 muT/s < B(e) < 10 mT/s. We have observed the inverse dependence of tau0 upon B(e), with tau0 ranging from 1 s to 10(3) s and reaching 5000 s at B(e) = 5 muT/s, B = 6 T, and T = 20 K. It is shown that, in accordance with our model, the dependences of tau0 upon T and B coincide with those for the flux-creep rate M1(T,B) = dM/d lnt measured on the logarithmic stage of the flux creep. We have also measured the dependences of the initial magnetic moment M(0) on T, B, and B(e). Manifestations of the obtained results in magnetic and relaxation measurements on high-T(c) superconductors are discussed.