This content has been marked as final. Show 2 replies
Make myself more understood, I want to convert java.sql.Timestamp("1970-0101T16:00:00+8:00") from database to java.util.Timestamp("1970-01-01T16:00:00*UTC*"). The literal is same.
Seems like an odd request.
1. If your database does NOT specify a timezone then the jdbc connection string would have a way to do that explicitly.
2. If you database DOES specify a timezone then you would need to write SQL (not java) that returned a unspecified timezone value, probably a string, which you would use to create a java timestamp (for example via SimpleDateFormat).
The above or course presumes that you understand that the jdbc has perfectly acceptable ways of getting correct timestamps from databases and that displaying a timestamp value has nothing to do with that.