Refactored date handling, unix timestamps are now more reliable