Converting date into unix timestamp not giving expected result
I found the solution .

If we select Field type as Date(Unix Timestamp) then $entity-&gt;field_dob1[0]['value'] will return unix timestamp value which can be directly used.

So if anyone in same requirement can use the following code: 

$bdayunix = $entity-&gt;field_date_of_birth['und'][0]['value'];
$nowunix = time();
$unixage = $nowunix - $bdayunix;
$age = floor($unixage/ (365 * 24 * 60 * 60));

$entity_field[0]['value'] = $age;


PS: Dont forget to select field type as Date(Unix Timestamp).