I am using my Java application to retrieve data from a table, which has a datetime field in it. My ResultSet is giving me a Number Format error due to the time zone number added by the Postgres.

The date format I am looking for is MM-dd-yyyy hh:mm:ss a eg: 07-12-2002 12:34:35 PM. But Postgres returns me a format like this: 07-12-2002 12:34:35-04. The additional 04 for time zone is invoking the Number Format Exception in Java Class. Appreciate your suggestions to change the datetime format in Postgres.

I set DATESTYLE to SQL and ISO. But still gets this error.