Examples of atStartOfDay()


Examples of java.time.LocalDate.atStartOfDay()

        /*
         * We need to convert to legacy Date using instant until JAX-RS can
         * handle Java 8 types...
         */
        LocalDate ldBirth = LocalDate.parse(isoDateOfBirth, DateTimeFormatter.ISO_LOCAL_DATE);
        Instant iBirth = ldBirth.atStartOfDay(ZoneId.systemDefault()).toInstant();

        Random r = new Random(123);

        EmployeeEntity newEmployee = new EmployeeEntity(r.nextLong(), name, Date.from(iBirth));

View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

  private static ZonedDateTimeDoubleTimeSeries convertTimeSeries(final ZoneId timeZone, final LocalDateDoubleTimeSeries localDateTS) {
    // FIXME Converting a daily historical time series to an arbitrary time - should not happen
    final ZonedDateTimeDoubleTimeSeriesBuilder bld = ImmutableZonedDateTimeDoubleTimeSeries.builder(timeZone);
    for (final LocalDateDoubleEntryIterator it = localDateTS.iterator(); it.hasNext(); ) {
      final LocalDate date = it.nextTime();
      final ZonedDateTime zdt = date.atStartOfDay(timeZone);
      bld.put(zdt, it.currentValueFast());
    }
    return bld.build();
  }
}
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

      deliveryDate = LocalDate.parse(deliveryDateStr);
    } catch (DateTimeParseException ex) {
      _logger.warn("delivery date not in mm/dd/yyyy format - {}", deliveryDateStr);
      return null;
    }
    return deliveryDate.atStartOfDay(ZoneOffset.UTC);
  }

  //------------------------------------------------------------------------- 
  /**
   * Parses the expiry field.
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

  private static ZonedDateTimeDoubleTimeSeries convertTimeSeries(final ZoneId timeZone, final LocalDateDoubleTimeSeries localDateTS) {
    // FIXME CASE Converting a daily historical time series to an arbitrary time. Bad idea
    final ZonedDateTimeDoubleTimeSeriesBuilder bld = ImmutableZonedDateTimeDoubleTimeSeries.builder(timeZone);
    for (final LocalDateDoubleEntryIterator it = localDateTS.iterator(); it.hasNext();) {
      final LocalDate date = it.nextTime();
      final ZonedDateTime zdt = date.atStartOfDay(timeZone);
      bld.put(zdt, it.currentValueFast());
    }
    return bld.build();
  }
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

  private static ZonedDateTimeDoubleTimeSeries convertTimeSeries(final ZoneId timeZone, final LocalDateDoubleTimeSeries localDateTS) {
    // FIXME CASE Converting a daily historical time series to an arbitrary time. Bad idea
    final ZonedDateTimeDoubleTimeSeriesBuilder bld = ImmutableZonedDateTimeDoubleTimeSeries.builder(timeZone);
    for (final LocalDateDoubleEntryIterator it = localDateTS.iterator(); it.hasNext();) {
      final LocalDate date = it.nextTime();
      final ZonedDateTime zdt = date.atStartOfDay(timeZone);
      bld.put(zdt, it.currentValueFast());
    }
    return bld.build();
  }
}
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

    final LocalDateDoubleTimeSeries localDateTS = ts.getTimeSeries();
    // FIXME CASE Converting a daily historical time series to an arbitrary time. Bad idea
    final ZonedDateTime[] instants = new ZonedDateTime[localDateTS.size()];
    for (final LocalDateDoubleEntryIterator it = localDateTS.iterator(); it.hasNext(); ) {
      final LocalDate date = it.nextTime();
      instants[it.currentIndex()] = date.atStartOfDay(ZoneOffset.UTC);
    }
    return ImmutableZonedDateTimeDoubleTimeSeries.of(instants, localDateTS.valuesArrayFast(), ZoneOffset.UTC);
  }

  private ExternalIdBundle getIndexIdForSwap(final FloatingInterestRateLeg floatingLeg) {
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

      s_logger.error("can't find time series for {} on {}", swapRateForMaturityIdentifier, tradeDate);
      return null;
    }
    Double fixedRate = (fixedRateSeries.getTimeSeries().getEarliestValue() + getRandom().nextDouble()) / 100d;
    Double notional = (double) (getRandom(99999) + 1) * 1000;
    ZonedDateTime tradeDateTime = tradeDate.atStartOfDay(ZoneOffset.UTC);
    ZonedDateTime maturityDateTime = tradeDate.plus(maturity.getPeriod()).atStartOfDay(ZoneOffset.UTC);
    String counterparty = "CParty";
    SwapLeg fixedLeg = new FixedInterestRateLeg(swapConvention.getSwapFixedLegDayCount(),
        swapConvention.getSwapFixedLegFrequency(),
        swapConvention.getSwapFixedLegRegion(),
View Full Code Here

Examples of org.threeten.bp.LocalDate.atStartOfDay()

      if (tenorOrDate.startsWith("P")) { // tenor
        final Tenor tenor = Tenor.of(Period.parse(tenorOrDate));
        dates.add(IMMDateGenerator.getNextIMMDate(now, tenor));
      } else { // date
        final LocalDate date = LocalDate.parse(tenorOrDate);
        dates.add(date.atStartOfDay(now.getZone()));
      }
    }
    return dates.toArray(new ZonedDateTime[dates.size()]);
  }
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.