Another answer shows how to set a default timestamp. However, it updates only the entry you edit. I was wondering if there is another way that would edit, let’s say, the current year in all the entries.
For example, my database has 2 entries that were inserted in the year 2011, so the current date column for the 2 entries would be 2011. I would like to make this column update to 2012 when a new user is inserted, which means now there would be 3 entries and the current year column for all 3 entries would be 2012.
Is this possible?
My main objective is to calculate age.
You really don’t need to – and should NOT – store the current year in a table’s column (and possibly in several million rows) – unless you are writing a Star Trek application where some characters live in 2012 and others in 42012 (in other words if the “current year” is not the same for all).
You can always use this in your computations: