Various ORMs (like Rails’ ActiveRecord, Sequelize, etc) offer you the option of adding timestamps for the moment a record is created and updated. The created stamp is easy to do by simply giving it a default value of NOW(), but an updated_at stamp needs to change every time the row does.
Working for one client, I had to write a widget that would JustWork™ in clients’ websites, adapting to their colour schemes and not interfering in their own scripts. It’s actually not that hard when you identify the requirements of what you’re doing! I thought I’d share my learnings with the community.