Abundance determinations for s-process elements in open clusters and young associations have revealed the presence of an anti-correlation between the Ba abundance and the age. The reason of such a peculiar trend is yet to be understood, however we can take advantage of this trend in Ba abundances to provide an independent information on the stellar age, which is particularly critical for planet-host stars. I will present in this contribution our results focusing on young open clusters and field stars known to host planetary companions.