We present a measurement of time-dependent rate asymmetries in B0→ϕKS0 decays to search for non-standard-model physics in b→qqs transitions. The data sample is collected with the Belle II detector at the SuperKEKB asymmetric-energy e+e− collider in 2019-2022 and contains (387±6)×106 bottom-antibottom mesons from Υ(4S) resonance decays. We reconstruct 162±17 signal events and extract the charge-parity (CP) violating parameters from a fit to the distribution of the proper-decay-time difference of the two B mesons. The measured direct and mixing-induced CP asymmetries are A=0.31±0.20±0.05 and S=0.54±0.26−0.08+0.06, respectively, where the first uncertainties are statistical and the second are systematic. The results are compatible with the CP asymmetries observed in b→ccs transitions.