Examples of atTime()


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

  private static final long serialVersionUID = 1L;

  @Override
  public ZonedDateTime adjustDate(final Calendar workingDayCalendar, final ZonedDateTime dateTime) {
    LocalDate adjusted = adjustDate(workingDayCalendar, dateTime.toLocalDate());
    return adjusted.atTime(dateTime.toLocalTime()).atZone(dateTime.getZone());
  }

  @Override
  public TemporalAdjuster getTemporalAdjuster(final Calendar workingDayCalendar) {
    return new BusinessDayConventionWithCalendar(this, workingDayCalendar);
View Full Code Here

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

  private SwapSecurity getTenorSwap(final InterpolatedYieldCurveSpecification spec, final FixedIncomeStripWithIdentifier strip, final SnapshotDataBundle marketValues) {
    final ExternalId swapIdentifier = strip.getSecurity();
    final Double rate = marketValues.getDataPoint(swapIdentifier);
    final LocalDate curveDate = spec.getCurveDate();
    final ZonedDateTime tradeDate = curveDate.atTime(11, 00).atZone(ZoneOffset.UTC);
    final ZonedDateTime effectiveDate = DateUtils.previousWeekDay(curveDate.plusDays(3)).atTime(11, 00).atZone(ZoneOffset.UTC);
    final ZonedDateTime maturityDate = curveDate.plus(strip.getMaturity().getPeriod()).atTime(11, 00).atZone(ZoneOffset.UTC);
    final ConventionBundle convention = _conventionBundleSource.getConventionBundle(ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, spec.getCurrency().getCode() + "_TENOR_SWAP"));
    final String counterparty = "";
    final ConventionBundle payLegFloatRateConvention = _conventionBundleSource.getConventionBundle(convention.getBasisSwapPayFloatingLegInitialRate());
View Full Code Here

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

          final Month month = s_monthCode.inverse().get(monthCode);
          if (month == null) {
            throw new OpenGammaRuntimeException("Invalid month code " + monthCode);
          }
          LocalDate nextExpiryIfThisYear = LocalDate.of((((thisYear / 10) * 10) + year), month, 1).with(s_monthlyExpiryAdjuster);
          ZonedDateTime nextExpiryDateTimeIfThisYear = nextExpiryIfThisYear.atTime(futureExpiryTime).atZoneSimilarLocal(futureExpiryTimeZone);
          if (now.isAfter(nextExpiryDateTimeIfThisYear)) {
            year = ((thisYear / 10) * 10) + 10 + year;
          } else {
            year = ((thisYear / 10) * 10) + year;
          }
View Full Code Here

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

      }
      // phew.
      // now we generate the expiry of the future from the code:
      // Again, note that we're not taking into account exchange trading hours.
      LocalDate expiryDate = LocalDate.of(year, s_monthCode.inverse().get(monthCode), 1).with(s_monthlyExpiryAdjuster);
      ZonedDateTime expiry = expiryDate.atTime(futureExpiryTime).atZoneSimilarLocal(futureExpiryTimeZone);
      int quarters = (int) nextExpiry.periodUntil(expiry, MONTHS) / 3;
      int genericFutureNumber = quarters + 1;
      StringBuilder sb = new StringBuilder();
      sb.append(typeCode);
      sb.append(genericFutureNumber);
View Full Code Here

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

  private static InterpolatedYieldCurveSpecificationWithSecurities resolveToDummySecurity(final InterpolatedYieldCurveSpecification curveSpecification, final SnapshotDataBundle marketData,
      final Currency currency) {
    final Collection<FixedIncomeStripWithSecurity> securityStrips = new TreeSet<>();
    final LocalDate curveDate = curveSpecification.getCurveDate();
    for (final FixedIncomeStripWithIdentifier strip : curveSpecification.getStrips()) {
      final ZonedDateTime start = curveDate.atTime(CASH_EXPIRY_TIME).atZone(ZoneOffset.UTC);
      final ZonedDateTime maturity = curveDate.plus(strip.getMaturity().getPeriod()).atTime(CASH_EXPIRY_TIME).atZone(ZoneOffset.UTC);
      final Tenor resolvedTenor = Tenor.of(Period.between(curveDate, maturity.toLocalDate()));
      final CashSecurity security = new CashSecurity(currency, curveSpecification.getRegion(), start, maturity, DAY_COUNT, 0, 0);
      securityStrips.add(new FixedIncomeStripWithSecurity(strip.getStrip(), resolvedTenor, maturity, strip.getSecurity(), security));
    }
View Full Code Here

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

    // These will need to be sorted out.
    LocalTime expiryTime = LocalTime.of(17, 00);
    ZoneId zone = ZoneOffset.UTC;
    LocalDate localDate = LocalDate.parse(fieldData.getString(fieldName));
    return localDate.atTime(expiryTime).atZone(zone);
  }

  //-------------------------------------------------------------------------
  @Override
  protected ManageableSecurity createSecurity(FudgeMsg fieldData) {
View Full Code Here

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

/* package */ class ZonedDateTimeConverter implements StringConverter<ZonedDateTime> {

  @Override
  public ZonedDateTime convertFromString(Class<? extends ZonedDateTime> cls, String localDateString) {
    LocalDate localDate = LocalDate.parse(localDateString);
    return localDate.atTime(11, 0).atZone(ZoneOffset.UTC);
  }

  @Override
  public String convertToString(ZonedDateTime dateTime) {
    return dateTime.toLocalDate().toString();
View Full Code Here

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

/* package */ class ExpiryConverter implements StringConverter<Expiry> {

  @Override
  public Expiry convertFromString(Class<? extends Expiry> cls, String localDateString) {
    LocalDate localDate = LocalDate.parse(localDateString);
    return new Expiry(localDate.atTime(11, 0).atZone(ZoneOffset.UTC));
  }

  @Override
  public String convertToString(Expiry expiry) {
    return expiry.getExpiry().toLocalDate().toString();
View Full Code Here

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

            LocalDate premiumDate = LocalDate.parse(tradeJson.getString("premiumDate"));
            trade.setPremiumDate(premiumDate);
            if (tradeJson.has("premiumTime")) {
              LocalTime premiumTime = LocalTime.parse(tradeJson.getString("premiumTime"));
              ZoneOffset premiumOffset = getOffset(tradeJson, "premiumOffset");
              ZonedDateTime zonedDateTime = premiumDate.atTime(premiumTime).atZone(premiumOffset);
              trade.setPremiumTime(zonedDateTime.toOffsetDateTime().toOffsetTime());
            }
          }
          if (tradeJson.has("quantity")) {
            trade.setQuantity(new BigDecimal(tradeJson.getString("quantity")));
View Full Code Here

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

            LocalDate tradeDate = LocalDate.parse(tradeJson.getString("tradeDate"));
            trade.setTradeDate(tradeDate);
            if (tradeJson.has("tradeTime")) {
              LocalTime tradeTime = LocalTime.parse(tradeJson.getString("tradeTime"));
              ZoneOffset tradeOffset = getOffset(tradeJson, "tradeOffset");
              ZonedDateTime zonedDateTime = tradeDate.atTime(tradeTime).atZone(tradeOffset);
              trade.setTradeTime(zonedDateTime.toOffsetDateTime().toOffsetTime());
            }   
          }
          addTradeAttributes(trade, tradeJson);
          trades.add(trade);
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.