I am looking for really good examples on how to work with date or datetime or how to update them correctly on a databases so that they can be "up to date". I have had this issues before with sql, when using date or datetime they would not update after I use them. The only time I could modify them would be when inserting into the table. Also, the same applied when I used a JDBC connector to create an interface for the database. The data would modify only at inserting and not when altering. What to use when altering a table? Update?
Example: I have an online store in which I have "Products for sale" with fields in which day I created the Product and what day I restocked(when creating restocked will have the same value as created.). I create a new product, after 3 days I restock. How can I correctly alter the product so that the day I restocked is today, not 3 days away when I first created the product? I am using MySQL WORKBENCH 6.0 CE. Any suggestions will be appreciated. Thank you!