Make sure API datetime is integer before converting