Let X be a Lévy process on the real line, and let Fc denote the generalized arcsine law on [0, 1] with parameter c. Then t−1 ⨍0tP0(Xs > 0) ds → c as t → ∞ is a necessary and sufficient condition for t—1 ⨍0t1{Xs>0}ds to converge in P0 law to Fc. Moreover, P0(Xt > 0) = c for all t > 0 is a necessary and sufficient condition for t—1 ⨍0t1{Xs>0}ds under P0 to have law Fc for all t > 0. We give an elementary proof of these results, and show how to derive Spitzer's theorem for random walks in a simple way from the Lévy process version.