Home / News Articles / Pokémon Brilliant Diamond and Pokémon Shining Pearl - Version 1.3.0 Update

Rich Caniglia Age -

from datetime import datetime

# Example usage: db = Database() # assume a Database class to interact with the database age_tracker = AgeTracker(db)

def get_age(self, name): birthdate = self.db.get_birthdate(name) if birthdate: today = datetime.today() age = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month, birthdate.day)) return age return None