title: How to get relevant month and date by inputting only the day of year in python
body: <p>I'm developing a phonebook application from python as a mini project in which I'm having the requirement to store the NIC number of a person and then display his/her gender, DOB and age. I have to derive these 3 information and I'm able to derive the gender, but I don't know how to derive the DOB - only the birth year because the NIC number's first 2 digits represent the year of birth.</p>
  
  <p>In a NIC number, the 3rd three digits are the day of year :- from 001 to 366. I can seperate those 3 digits to another variable as well, but how do I derive the month and the date of month which it refers to?</p>
  
  <p>For example :</p>
  
  <pre><code>derivedYear = 1996
  dayOfYear = 032
  
  finalDOB = "1996.02.01"
  print finalDOB
  </code></pre>
  
  <p>I want to know how to calculate the finalDOB value. I'm using python 2.7.6</p>