Projects Directory : complex curl script get result - Complex datetime differences in PostgreSQL