Year end sale - depreciation counted

Is there a solid rule for when to count depreciation for the year when the sale takes place on Dec. 31? Do I assume we depreciate the asset for the year before the sale to reach the book value?