@Test public void testEpochMicrosToTimestamp() { assertEquals("2020-01-12T21:02:18.123456Z", Time.epochMicrosToTimestamp(1578862938123456L)); }
public static String epochMicrosToTimestamp(Long epochMicros) { try { long epochSeconds = epochMicros / 1_000_000; long nanos = epochMicros % 1_000_000 * 1000; return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochSecond(epochSeconds, nanos)); } catch (DateTimeParseException | NullPointerException ignore) { return null; } }
Time { public static String epochMicrosToTimestamp(Long epochMicros) { try { long epochSeconds = epochMicros / 1_000_000; long nanos = epochMicros % 1_000_000 * 1000; return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochSecond(epochSeconds, nanos)); } catch (DateTimeParseException | NullPointerException ignore) { return null; } } }
Time { public static String epochMicrosToTimestamp(Long epochMicros) { try { long epochSeconds = epochMicros / 1_000_000; long nanos = epochMicros % 1_000_000 * 1000; return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochSecond(epochSeconds, nanos)); } catch (DateTimeParseException | NullPointerException ignore) { return null; } }  }
Time { public static String epochMicrosToTimestamp(Long epochMicros) { try { long epochSeconds = epochMicros / 1_000_000; long nanos = epochMicros % 1_000_000 * 1000; return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochSecond(epochSeconds, nanos)); } catch (DateTimeParseException | NullPointerException ignore) { return null; } }  static org.joda.time.Duration parseDuration(String value); static ValueProvider<org.joda.time.Duration> parseDuration(ValueProvider<String> value); static long parseSeconds(String value); static ValueProvider<Long> parseSeconds(ValueProvider<String> value); static Instant parseAsInstantOrNull(String timestamp); static String epochMicrosToTimestamp(Long epochMicros); static String epochNanosToTimestamp(Long epochNanos); }
Time { public static String epochMicrosToTimestamp(Long epochMicros) { try { long epochSeconds = epochMicros / 1_000_000; long nanos = epochMicros % 1_000_000 * 1000; return DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochSecond(epochSeconds, nanos)); } catch (DateTimeParseException | NullPointerException ignore) { return null; } }  static org.joda.time.Duration parseDuration(String value); static ValueProvider<org.joda.time.Duration> parseDuration(ValueProvider<String> value); static long parseSeconds(String value); static ValueProvider<Long> parseSeconds(ValueProvider<String> value); static Instant parseAsInstantOrNull(String timestamp); static String epochMicrosToTimestamp(Long epochMicros); static String epochNanosToTimestamp(Long epochNanos);  }