congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
java.time
Code IndexAdd Tabnine to your IDE (free)

How to use java.time

Best Java code snippets using java.time (Showing top 20 results out of 17,433)

origin: spring-projects/spring-framework

  @Override
  public Long convert(Instant source) {
    return source.toEpochMilli();
  }
}
origin: spring-projects/spring-framework

@Override
public ResponseCookieBuilder maxAge(long maxAgeSeconds) {
  this.maxAge = maxAgeSeconds >= 0 ? Duration.ofSeconds(maxAgeSeconds) : Duration.ofSeconds(-1);
  return this;
}
origin: spring-projects/spring-framework

  @Override
  public OffsetDateTime convert(Calendar source) {
    return calendarToZonedDateTime(source).toOffsetDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public Instant convert(Long source) {
    return Instant.ofEpochMilli(source);
  }
}
origin: spring-projects/spring-framework

  @Override
  public Instant convert(Calendar source) {
    return calendarToZonedDateTime(source).toInstant();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDate convert(LocalDateTime source) {
    return source.toLocalDate();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDate convert(Calendar source) {
    return calendarToZonedDateTime(source).toLocalDate();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDateTime convert(Calendar source) {
    return calendarToZonedDateTime(source).toLocalDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public Instant convert(OffsetDateTime source) {
    return source.toInstant();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalTime convert(LocalDateTime source) {
    return source.toLocalTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalTime convert(ZonedDateTime source) {
    return source.toLocalTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDate convert(OffsetDateTime source) {
    return source.toLocalDate();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDateTime convert(OffsetDateTime source) {
    return source.toLocalDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public ZonedDateTime convert(OffsetDateTime source) {
    return source.toZonedDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalTime convert(OffsetDateTime source) {
    return source.toLocalTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public Instant convert(ZonedDateTime source) {
    return source.toInstant();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDate convert(ZonedDateTime source) {
    return source.toLocalDate();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalDateTime convert(ZonedDateTime source) {
    return source.toLocalDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public OffsetDateTime convert(ZonedDateTime source) {
    return source.toOffsetDateTime();
  }
}
origin: spring-projects/spring-framework

  @Override
  public LocalTime convert(Calendar source) {
    return calendarToZonedDateTime(source).toLocalTime();
  }
}
java.time

Most used classes

  • Instant
    An instantaneous point on the time-line. This class models a single instantaneous point on the time-
  • Duration
    A time-based amount of time, such as '34.5 seconds'. This class models a quantity or amount of time
  • LocalDateTime
    A date-time without a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30. LocalD
  • ZonedDateTime
    A date-time with a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00 Euro
  • LocalDate
    A date without a time-zone in the ISO-8601 calendar system, such as 2007-12-03. LocalDate is an imm
  • ZoneId,
  • LocalTime,
  • OffsetDateTime,
  • Clock,
  • ZoneOffset,
  • ChronoUnit,
  • Period,
  • YearMonth,
  • OffsetTime,
  • Year,
  • Month,
  • DayOfWeek,
  • DateTimeFormatterBuilder,
  • TemporalAccessor
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now