Context. NGC 4993 is the shell galaxy host of the GRB170817A short gamma-ray burst and the GW170817 gravitational-wave event produced during a binary-neutron-star coalescence.Aims. The galaxy shows signs, including the stellar shells, that it has recently accreted a smaller, late-type galaxy. The accreted galaxy might be the original host of the binary neutron star.Methods. We measured the positions of the stellar shells of NGC 4993 in an HST/ACS archival image and use the shell positions to constrain the time of the galactic merger.Results. According to the analytical model of the evolution of the shell structure in the expected gravitational potential of NGC 4993, the galactic merger happened at least 200 Myr ago, with a probable time roughly around 400 Myr, and the estimates higher than 600 Myr being improbable. This constitutes the lower limit on the age of the binary neutron star, because the host galaxy was probably quenched even before the galactic merger, and the merger has likely shut down the star formation in the accreted galaxy. We roughly estimate the probability that the binary neutron star originates in the accreted galaxy to be around 30%.