Constructing a relative geologic time (RGT) image from a seismic image is crucial for seismic structural and stratigraphic interpretation. In conventional methods, automatic RGT estimation from a seismic image is typically based on only local image features, which makes it challenging to cope with discontinuous structures (e.g., faults and unconformities). We have considered the estimation of 2D RGT images as a regression problem, where we design a deep convolutional neural network (CNN) to directly and automatically compute an RGT image from a 2D seismic image. This CNN consists of three parts: an encoder, a decoder, and a refinement module. We train this CNN by using 2080 pairs of synthetic input seismic images and target RGT images, and then we test it on 960 testing seismic images. Although trained with only synthetic images, the network can generate accurate results on real seismic images. Multiple field examples show that our CNN-based method is significantly superior to conventional methods, especially in dealing with complex structures such as crossing faults and complicatedly folded horizons, without the need of any manual picking.