Context : Helioseismology has revealed that the angular velocity of the Sun increases with depth in the outermost 35 Mm of the Sun . Recently , we have shown that the logarithmic radial gradient ( { d } { } \ln \Omega / { d } { } \ln r ) in the upper 10 Mm is close to -1 from the equator to 60 ^ { \circ } latitude . Aims : We aim to measure the temporal variation of the rotational shear over solar cycle 23 and the rising phase of cycle 24 ( 1996-2015 ) . Methods : We used f mode frequency splitting data spanning 1996 to 2011 from the Michelson Doppler Imager ( MDI ) and 2010 to 2015 from the Helioseismic Magnetic Imager ( HMI ) . In a first for such studies , the f mode frequency splitting data were obtained from 360-day time series . We used the same method as in our previous work for measuring { d } { } \ln \Omega / { d } { } \ln r from the equator to 80 ^ { \circ } latitude in the outer 13 Mm of the Sun . Then , we calculated the variation of the gradient at annual cadence relative to the average over 1996 to 2015 . Results : We found the rotational shear at low latitudes ( 0 ^ { \circ } to 30 ^ { \circ } ) to vary in-phase with the solar activity , varying by \sim \pm 10 % over the period 1996 to 2015 . At high latitudes ( 60 ^ { \circ } to 80 ^ { \circ } ) , we found rotational shear to vary in anti-phase with the solar activity . By comparing the radial gradient obtained from the splittings of the 360-day and the corresponding 72-day time series of HMI and MDI data , we suggest that the splittings obtained from the 72-day HMI time series suffer from systematic errors . Conclusions : We provide a quantitative measurement of the temporal variation of the outer part of the near surface shear layer which may provide useful constraints on dynamo models and differential rotation theory .