Towards 1967, the accuracy of caesium frequency standards reached such a level that the relativistic effect could not be ignored anymore. Corrections began to be applied for the gravitational frequency shift and for distant time comparisons. However, these corrections were not applied to an explicit theoretical framework. Only in 1991 did the International Astronomical Union provide metrics (then improved in 2000) for a definition of spacetime coordinates in reference systems centred at the barycentre of the Solar System and at the centre of mass of the Earth. In these systems, the temporal coordinates (coordinate times) can be realized on the basis of one of them, the International Atomic Time (TAI), which is itself a realized time scale. The definition and the role of TAI in this context will be recalled. There remain controversies regarding the name to be given to the unit of coordinate times and to other quantities appearing in the theory. However, the idea that astrometry and celestial mechanics should adopt the usual metrological rules is progressing, together with the use of the International System of Units, among astronomers.