The time-dependent CP asymmetry in B_s^0to J/psi K^+K^- decays is measured using $pp$ collision data at sqrt{s}=7TeV, corresponding to an integrated luminosity of 1.0fb^-1, collected with the LHCb detector. The decay time distribution is characterised by the decay widths Gamma_L and Gamma_H of the light and heavy mass eigenstates of the B_s^0--bar{B}_s^0 system and by a CP-violating phase phi_s. In a sample of 27,617 B_s^0to J/psi K^+K^- decays, where the dominant contribution comes from B_s^0to J/psiphi decays, these parameters are measured to be phi_s = 0.07 pm 0.09 (stat) pm 0.01 (syst) rad, Gamma_s equiv (Gamma_L+Gamma_H)/2 = 0.663 pm 0.005 (stat) pm 0.006 (syst) ps^-1, DeltaGamma_s equiv Gamma_L -Gamma_H = 0.100 pm 0.016 (stat) pm 0.003 (syst) & ps^-1, corresponding to the single most precise determination of phi_s, DeltaGamma_s and Gamma_s. The result of performing a combined analysis with B_s^{0} to J/psi pi^+pi^- decays gives phi_s = 0.01 pm 0.07 (stat) pm 0.01 (syst) rad, Gamma_s = 0.661 pm 0.004 (stat) pm 0.006 (syst) ps^-1, DeltaGamma_s = 0.106 pm 0.011 (stat) pm 0.007 (syst) & ps^-1. All measurements are in agreement with the Standard Model predictions.