Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse.com - JSON Import Date Field Error

I am trying to import some JSON data into one of my tables in Parse.com. When doing so, I get the following error:

Import encountered the following error: error 111: invalid type for key startDate, expected date, but got string

The data is below:

[
  {
    "title":"Software Webinar",
    "location":"Kingsview Financial",
    "host":"Josh Chase",
    "startDate":"10/13/2014 12:30",
    "EndDate":"10/13/2014 13:30",
    "eventType":"TA",
    "eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
  }
]

I've tinkered with the date format a bit but to no avail. Just trying to import some data, and have to use JSON data to do so. Thanks for any help.

like image 578
Noah Labhart Avatar asked May 16 '26 01:05

Noah Labhart


1 Answers

Formate your date like this:

"startDate": {

    "__type": "Date",
    "iso": "2014-10-13T12:30:00.000Z"
}

You JSON will look something like this:

[
  {
    "title":"Software Webinar",
    "location":"Kingsview Financial",
    "host":"Josh Chase",
    "startDate": {

        "__type": "Date",
        "iso": "2014-10-13T12:30:00.000Z"
    },
    "EndDate": {

        "__type": "Date",
        "iso": "2014-10-13T13:30:00.000Z"
    },
    "eventType":"TA",
    "eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
  }
]

Hope this helps.. :)

like image 121
Rashad Avatar answered May 17 '26 14:05

Rashad