Nico, you were right, it does work and I found out what causing the errors. Some of the records I used contained values before the epoch (January/1/1970) and that is causing the script to return December 31, 1969 for all of those records.
So my question is, is there any way to get around this so that values pre 1970 would work?