public static Timestamp toTimestamp(String timestampString) {
    try {
      return Timestamp.valueOf(timestampString);
    } catch (Exception e) {
      // Try the next format
    }
    try {
      return new Timestamp(Long.parseLong(timestampString));
    } catch (Exception e) {
    }
    try {
      return Timestamp.from(ZonedDateTime.parse(timestampString, UNIVERSAL_DATE_TIME_FORMATTER).toInstant());
    } catch (Exception e) {
      // Try the next format
    }
    try {
      LocalDateTime dateTime = LocalDateTime.parse(timestampString, UNIVERSAL_DATE_TIME_FORMATTER);
      return Timestamp.valueOf(dateTime);
    } catch (Exception e) {
      throw new IllegalArgumentException(String.format("Invalid timestamp: '%s'", timestampString));
    }
  }
@Test
  public void testTimestampFormatsWithZone() {
    // ISO8601 with various timezone offsets
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36+02:00"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 0, ZoneId.of("+02:00")).toInstant()));
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36-05:00"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 0, ZoneId.of("-05:00")).toInstant()));

    // ISO8601 with milliseconds and various timezones
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36.123Z"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 123000000, ZoneId.of("Z")).toInstant()));
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36.123+01:30"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 123000000, ZoneId.of("+01:30")).toInstant()));
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36.123-08:00"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 123000000, ZoneId.of("-08:00")).toInstant()));

    // Testing edge cases like half-hour and quarter-hour time zones
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36+05:45"),
        Timestamp.from(
            ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 0, ZoneId.of("+05:45")).toInstant())); // Nepal Time Zone
    assertEquals(TimestampUtils.toTimestamp("2024-07-12T15:32:36+08:45"),
        Timestamp.from(ZonedDateTime.of(2024, 7, 12, 15, 32, 36, 0, ZoneId.of("+08:45"))
            .toInstant())); // Australian Central Western Standard Time
  }