Send date time to elasticsearch from php

(Nabha Shirkul) #1

I am sending json data from php to elasticsearch. My Json object has a field named as date which contains date time.
[{"date":"2018-05-15 00:00:01", "reading" : 0},
{"date":"2018-05-15 02:00:00", "reading" : 50},
{"date":"2018-05-15 04:00:00", "reading" : 110},
{"date":"2018-05-15 06:00:00", "reading" : 176},
{"date":"2018-05-15 08:00:00", "reading" : 200}]

The data is getting added successfully to elasticsearch, but "date" goes in string format and not in datetime format. I also converted the date in date time format using php function, still not working.
Please help.

(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.