public static long toPostgreSQLTime(final Timestamp timestamp) {
        long millis = timestamp.getTime() - (timestamp.getNanos() / 1000000L) + (TimeZone.getDefault().getRawOffset());
        long nanos = timestamp.getNanos() / 1000L;
        long pgSeconds = convertJavaEpochToPgEpoch(millis / 1000L);
        if (nanos >= 1000000L) {
            nanos -= 1000000L;
            pgSeconds++;
        }
        return pgSeconds * 1000000L + nanos;
    }
@Test
    void assertToPostgreSQLTimeWithoutTimeZone() {
        long expected = 688123357272000L + TimeZone.getDefault().getRawOffset() * 1000L;
        assertThat(PostgreSQLBinaryTimestampUtils.toPostgreSQLTime(new Timestamp(1634808157272L)), is(expected));
    }