We store our createdAt fields in DynamoDB as Strings in ISO 8601 format in the sort key. That format is designed to be sortable for a date value. Recommend using that over an integer for the date value