private static String sanitizeTimestamp(long micros, long now) {
    String isPast = now > micros ? "ago" : "from-now";
    long diff = Math.abs(now - micros);
    if (diff < FIVE_MINUTES_IN_MICROS) {
      return "(timestamp-about-now)";
    }

    long hours = TimeUnit.MICROSECONDS.toHours(diff);
    if (hours <= THREE_DAYS_IN_HOURS) {
      return "(timestamp-" + hours + "-hours-" + isPast + ")";
    } else if (hours < NINETY_DAYS_IN_HOURS) {
      long days = hours / 24;
      return "(timestamp-" + days + "-days-" + isPast + ")";
    }

    return "(timestamp)";
  }
@Test
  public void testSanitizeTimestamp() {
    for (String timestamp :
        Lists.newArrayList(
            "2022-04-29T23:49:51",
            "2022-04-29T23:49:51.123456",
            "2022-04-29T23:49:51-07:00",
            "2022-04-29T23:49:51.123456+01:00")) {
      assertEquals(
          Expressions.equal("test", "(timestamp)"),
          ExpressionUtil.sanitize(Expressions.equal("test", timestamp)));

      assertEquals(
          Expressions.equal("ts", "(timestamp)"),
          ExpressionUtil.sanitize(STRUCT, Expressions.equal("ts", timestamp), true));

      assertThat(ExpressionUtil.toSanitizedString(Expressions.equal("test", timestamp)))
          .as("Sanitized string should be identical except for descriptive literal")
          .isEqualTo("test = (timestamp)");

      assertThat(ExpressionUtil.toSanitizedString(STRUCT, Expressions.equal("ts", timestamp), true))
          .as("Sanitized string should be identical except for descriptive literal")
          .isEqualTo("ts = (timestamp)");
    }
  }