If a person is alive at any time during the year, he/she is considered alive for the entire year.

Example 1: a child is born, but passes away that same day. He/she can be claimed by his parents as a tax dependent for that year;

Example 2: Your spouse passes away on December 15th of the year. You still can file a joint return with that spouse.