Java PostgreSQL timestamp to a Unix timestamp

Suppose we have a timestamp in the database and would like to convert it to a Unix timestamp
There is a function called getTime() that will return the unix time.

long messageTime = rs.getTimestamp("startTime", Calendar.getInstance(TimeZone.getTimeZone("UTC"))).getTime();