Package org.threeten.bp

Examples of org.threeten.bp.LocalDateTime.atOffset()


  @Override
  public void start() {
    LocalDateTime now = LocalDateTime.now();
    LocalDateTime nextHour = now.truncatedTo(HOURS).plusHours(1);
    Duration delay = Duration.between(now.atOffset(ZoneOffset.UTC), nextHour.atOffset(ZoneOffset.UTC));
    Duration oneHour = Duration.ofHours(1);
    s_logger.warn("Now {} Next {} Delay {} {}", new Object[] {now, nextHour, delay, delay.toMillis() });
    _timerExecutor.scheduleAtFixedRate(new SnapshotTask(), delay.toMillis(), oneHour.toMillis(), TimeUnit.MILLISECONDS);
    if (getInitializationFileName() != null) {
      initializeFromFile(getInitializationFileName());
View Full Code Here


   * @param timestamp  the SQL time-stamp to convert, not null
   * @return the instant, null if far-future
   */
  public static Instant fromSqlTimestamp(Timestamp timestamp) {
    LocalDateTime ldt = fromSqlDateTime(timestamp);
    return ldt.atOffset(ZoneOffset.UTC).toInstant();
  }

  /**
   * Creates an {@code Instant} from an SQL time-stamp treating null as far-future.
   *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.