Mike,
First of all, let's talk about the protocol, because that's important to understand. When connecting to the API, you send an S,SET PROTOCOL command to indicate which version of the syntax you want to use. It's a backwards compatibility feature; whenever DTN upgrades the API, it does so in a new protocol number, so existing code may continue to specify the old protocol until they have fully upgraded to it. The most recent protocol is 6.1, so this is the version you should be requesting, by sending S,SET PROTOCOL 6.1 when you initially connect. See
http://www.iqfeed.net/dev/api/docs/IQFeedProtocols.cfm for more details.
There are three interval history commands:
HIX - requests a number of intervals
HID - requests all intervals over a range of days
HIT - requests all intervals over a specified date-time range
Based on the presence of num_bars=100, I suspect it is an HIX request. What actually gets sent to the API is:
HIX,[Symbol],60,100
Which return data in the following format:
2020-05-05 15:11:00,300.9800,300.8000,300.8200,300.9100,27132732,35293,0,
2020-05-05 15:10:00,300.9200,300.7600,300.9050,300.8100,27089316,41483,0,
2020-05-05 15:09:00,300.9600,300.8800,300.9122,300.9047,27038363,37991,0,
Getting back to your original question: the date/time already appears to be in the date format Postgres takes. I'm not familiar with Postgres but you may need to convert it to timestamp form to store it:
https://www.postgresqltutorial.com/postgresql-to_timestamp/Quote: SELECT TO_TIMESTAMP('2017-03-31 9:30:20','YYYY-MM-DD HH:MI:SS');
Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist