import random
from time import gmtime, strftime


def generate_DOB(age=65):

  """Randomly generate a month & date for DOB """
  
  birth_month = random.randint(1,12)
  if birth_month == "1" or "3" or "5" or "7" or "8" or "10" or "12":
    birth_day = random.randint(1,31)
  if birth_month == "2":
    birth_day = random.randint(1,28)
  else:
    birth_day = random.randint(1,30)
  
  """Can not use the age generator function here for some reason but this code
  worked on generate_data_english.py.  For now, passing dummy age into the function
  to make it work for the time being.  I did input reference to import generator in
  the beginning of the program but got stuck on 'unicode_encoding' 
  
  age = generator.GenerateFreqAlt(attribute_name = 'agejy',
                    freq_file_name = 'lookup_files/age_gender_ratio_female.csv',
                    has_header_line = False,
                    unicode_encoding = unicode_encoding_used) """

  year_system = strftime ("%Y", gmtime())
  year_from_age = int(year_system) - age
  DOB = str(birth_month) +'/' + str(birth_day) + '/' + str(year_from_age)
  return DOB