A finite element method is presented to solve the problem of ocean tides. A spectral (in time) model is implemented by deriving a second order partial differential equation from the classical shallow-water equations. The influence of several key factors on the precision of the method are investigated: density of triangles, degree of approximation and numerical integration, computer costs. Two analytical solutions are used as a reference: a damped Kelvin amphidrome in a channel of constant depth over a rotating earth, and a tidal wave propagating from the deep ocean over a continental plateau. The efficiency of the P2-Lagrange approximation is clearly demonstrated in terms of precision and computer costs. A criterion is established to guarantee a given precision, relating the basic grid size of the triangulation to be used to the typical wavelength of the tidal wave. An application of the model to the solution of a problem including a variable topography, rotation, nonlinear bottom friction and a tide-generating potential forcing is presented as a final complex test.