From seconds ago to date - index fields

Hello,
I was wondering if it was possible to receive data containing values like “2 seconds ago” and, before entering them, transform them into “current date - 2 seconds ago”. Is it possible to make this calculation? Thank you