# Timestamps

You can implement the $beforeInsert and $beforeUpdate methods to set the timestamps. If you want to do this for all your models, you can simply create common base class that implements these methods.

class Person extends Model {
  $beforeInsert() {
    this.created_at = new Date().toISOString();
  }

  $beforeUpdate() {
    this.updated_at = new Date().toISOString();
  }
}