JDBC inserting a formatted date time into datetime field

Posted by MABeatty1978 on 21-Mar-2017 09:21

I have a java application that is putting a datetime value into a datetime field of a Progress db.

The java value is in yyyy-mm-ddT15:00:00.000-04:00 format

The format of the date time field is 9999-99-99 HH:MM:SS.SSS+HH:MM

I apply a SimpleDateFormat to the string as "yyyy-MM-dd HH:mm:ss.SSSXXX" to the value when inserting it into the database.  I can see the string value being inserted is: 2017-03-20 15:00:00.000-04:00 however, I'm getting an Invalid time string (7500) error.

Any help would be appreciated.  Thank you

All Replies

Posted by MABeatty1978 on 21-Mar-2017 09:28

I've removed the time zone from the string, "yyyy-MM-dd HH:mm:ss.SSS" and it inserts correctly into the database, so I know the issue is with the timezone format.  Any advice on how to fix the time zone?

Posted by gus bjorklund on 27-Mar-2017 11:20

Columns of the type datetime (called “timestamp” in SQL) do not include time zone information.

Columns of the type datetime-tz (called “timestamp with time zone”) DO have time zone information.

This thread is closed