fixed timestamp casting