I have referred to the psql documentation and came up with this query.
SELECT to_timestamp('Tue Aug 30 2016 04:07:13 GMT+0530 (IST)', 'Dy MON DD YYYY HH24:MI:SS');
This date time string Tue Aug 30 2016 04:07:13 GMT+0530 (IST)
is what I got from MongoDB printjson(createdAt).
The above postresql doesn't seem to work correctly for all offsets.
I tried this
select to_timestamp('Tue Aug 30 2016 04:07:13 GMT+0530 (IST)', 'Dy MON DD YYYY HH24:MI:SS "GMT"OF "(IST)"');
But I get this error ``ERROR: "TZ"/"tz"/"OF" format patterns are not supported in to_date`.
How to convert to psql timestamptz format from this string Tue Aug 30 2016 04:07:13 GMT+0530 (IST)
?