We establish improved uniform error bounds for the time-splitting methods for the long-time dynamics of the Schrödinger equation with small potential and the nonlinear Schrödinger equation (NLSE) with weak nonlinearity. For the Schrödinger equation with small potential characterized by a dimensionless parameter
ε
∈
(
0
,
1
]
\varepsilon \in (0, 1]
, we employ the unitary flow property of the (second-order) time-splitting Fourier pseudospectral (TSFP) method in
L
2
L^2
-norm to prove a uniform error bound at time
t
ε
=
t
/
ε
t_\varepsilon =t/\varepsilon
as
C
(
t
)
C
~
(
T
)
(
h
m
+
τ
2
)
C(t)\widetilde {C}(T)(h^m +\tau ^2)
up to
t
ε
≤
T
ε
=
T
/
ε
t_\varepsilon \leq T_\varepsilon = T/\varepsilon
for any
T
>
0
T>0
and uniformly for
ε
∈
(
0
,
1
]
\varepsilon \in (0,1]
, while
h
h
is the mesh size,
τ
\tau
is the time step,
m
≥
2
m \ge 2
and
C
~
(
T
)
\tilde {C}(T)
(the local error bound) depend on the regularity of the exact solution, and
C
(
t
)
=
C
0
+
C
1
t
C(t) =C_0+C_1t
grows at most linearly with respect to
t
t
with
C
0
C_0
and
C
1
C_1
two positive constants independent of
T
T
,
ε
\varepsilon
,
h
h
and
τ
\tau
. Then by introducing a new technique of regularity compensation oscillation (RCO) in which the high frequency modes are controlled by regularity and the low frequency modes are analyzed by phase cancellation and energy method, an improved uniform (w.r.t
ε
\varepsilon
) error bound at
O
(
h
m
−
1
+
ε
τ
2
)
O(h^{m-1} + \varepsilon \tau ^2)
is established in
H
1
H^1
-norm for the long-time dynamics up to the time at
O
(
1
/
ε
)
O(1/\varepsilon )
of the Schrödinger equation with
O
(
ε
)
O(\varepsilon )
-potential with
m
≥
3
m \geq 3
. Moreover, the RCO technique is extended to prove an improved uniform error bound at
O
(
h
m
−
1
+
ε
2
τ
2
)
O(h^{m-1} + \varepsilon ^2\tau ^2)
in
H
1
H^1
-norm for the long-time dynamics up to the time at
O
(
1
/
ε
2
)
O(1/\varepsilon ^2)
of the cubic NLSE with
O
(
ε
2
)
O(\varepsilon ^2)
-nonlinearity strength. Extensions to the first-order and fourth-order time-splitting methods are discussed. Numerical results are reported to validate our error estimates and to demonstrate that they are sharp.