How do I get when an entity was last updated? I found from the documentation that to get the created date I can use the    getCreatedTime() method.

How do I get when an entity was last updated?
If the entity uses the EntityChangedTrait (Drupal\Core\Entity\EntityChangedTrait), then you can use getChangedTime().