congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Year.atDay
Code IndexAdd Tabnine to your IDE (free)

How to use
atDay
method
in
java.time.Year

Best Java code snippets using java.time.Year.atDay (Showing top 15 results out of 315)

origin: com.thoughtworks.xstream/xstream

  return GregorianCalendar.from(y.atDay(1).atStartOfDay(ZoneId.systemDefault()));
} catch (final DateTimeParseException e) {
origin: org.codehaus.groovy/groovy-datetime

/**
 * Returns a {@link java.time.Period} between the first day of this year (inclusive) and the first day of the
 * provided {@link java.time.Year} (exclusive).
 *
 * @param self a Year
 * @param year another Year
 * @return a Period between the Years
 * @since 2.5.0
 */
public static Period rightShift(final Year self, Year year) {
  return Period.between(self.atDay(1), year.atDay(1));
}
origin: org.threeten/threeten-extra

/**
 * Combines this day-of-year with a year to create a {@code LocalDate}.
 * <p>
 * This returns a {@code LocalDate} formed from this day and the specified year.
 * <p>
 * This method can be used as part of a chain to produce a date:
 * <pre>
 *  LocalDate date = day.atYear(year);
 * </pre>
 * <p>
 * The day-of-year value 366 is only valid in a leap year.
 *
 * @param year  the year to use, not null
 * @return the local date formed from this day and the specified year, not null
 * @throws DateTimeException if the year is invalid or this is day 366 and the year is not a leap year
 */
public LocalDate atYear(Year year) {
  Objects.requireNonNull(year, "year");
  return year.atDay(day);
}
origin: mars-sim/mars-sim

  public static void getLocalDate(int year, int atDay) {
     LocalDate date = Year.of(year).atDay(atDay);
//          System.out.println(date);  
  }
  
origin: stackoverflow.com

 public static LocalDate randomDateIn(int year) {
  Year y = Year.of(year);
  return y.atDay(1+new Random().nextInt(y.length()));
}

System.out.println(randomDateIn(2014));
origin: no.ssb.vtl/java-vtl-model

  @Override
  public Instant get() {
    DateTimeFormatter formatter =
        DateTimeFormatter.ofPattern("yyyy");
    Year year = Year.parse(input, formatter);
    return year.atDay(1).atStartOfDay(timeZone.toZoneId()).toInstant();
  }
};
origin: edu.byu.hbll/time

 temporalAccessor = ((Year) temporalAccessor).atDay(1);
} else if (temporalAccessor instanceof YearMonth) {
 temporalAccessor = ((YearMonth) temporalAccessor).atDay(1);
origin: thymeleaf/thymeleaf-extras-java8time

  return ZonedDateTime.of(LocalDate.now(), localTime, defaultZoneId);
} else if (target instanceof Year) {
  LocalDate localDate = ((Year) target).atDay(1);
  return ZonedDateTime.of(localDate, LocalTime.MIDNIGHT, defaultZoneId);
} else if (target instanceof YearMonth) {
origin: Silverpeas/Silverpeas-Core

/**
 * Gets a window of time on this calendar defined by the specified period. The window of time
 * will include only the events in this calendar that occur in the specified period.
 * @param year the year during which the events in this calendar occur.
 * @return the window of time including the events in this calendar occurring in the given period.
 */
public CalendarTimeWindow in(final Year year) {
 return between(year.atDay(1), year.atMonth(DECEMBER).atEndOfMonth());
}
origin: chhsiao90/nitmproxy

public static Certificate newCert(String parentCertFile, String keyFile, String host) {
  try {
    Date before = Date.from(Instant.now());
    Date after = Date.from(Year.now().plus(3, ChronoUnit.YEARS).atDay(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
    X509CertificateHolder parent = readPemFromFile(parentCertFile);
    PEMKeyPair pemKeyPair = readPemFromFile(keyFile);
    KeyPair keyPair = new JcaPEMKeyConverter()
        .setProvider(PROVIDER)
        .getKeyPair(pemKeyPair);
    X509v3CertificateBuilder x509 = new JcaX509v3CertificateBuilder(
        parent.getSubject(),
        new BigInteger(64, new SecureRandom()),
        before,
        after,
        new X500Name("CN=" + host),
        keyPair.getPublic());
    ContentSigner signer = new JcaContentSignerBuilder("SHA256WithRSAEncryption")
        .build(keyPair.getPrivate());
    JcaX509CertificateConverter x509CertificateConverter = new JcaX509CertificateConverter()
        .setProvider(PROVIDER);
    return new Certificate(
        keyPair,
        x509CertificateConverter.getCertificate(x509.build(signer)),
        x509CertificateConverter.getCertificate(parent));
  } catch (Exception e) {
    throw new IllegalStateException(e);
  }
}
origin: edu.byu.hbll/time

 temporalAccessor = ((YearMonth) temporalAccessor).atDay(1).plusMonths(1L);
} else if (temporalAccessor instanceof Year) {
 temporalAccessor = ((Year) temporalAccessor).atDay(1).plusYears(1L);
origin: crawler-commons/crawler-commons

  ldt =  YearMonth.from(ta).atDay(1);
} else if (ta.isSupported(ChronoField.YEAR)) {
  ldt = Year.from(ta).atDay(1);
origin: x-stream/xstream

  return GregorianCalendar.from(y.atDay(1).atStartOfDay(ZoneId.systemDefault()));
} catch (final DateTimeParseException e) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

  return GregorianCalendar.from(y.atDay(1).atStartOfDay(ZoneId.systemDefault()));
} catch (final DateTimeParseException e) {
origin: apache/servicemix-bundles

  return GregorianCalendar.from(y.atDay(1).atStartOfDay(ZoneId.systemDefault()));
} catch (final DateTimeParseException e) {
java.timeYearatDay

Javadoc

Combines this year with a day-of-year to create a LocalDate.

This returns a LocalDate formed from this year and the specified day-of-year.

The day-of-year value 366 is only valid in a leap year.

Popular methods of Year

  • of
    Obtains an instance of Year. This method accepts a year value from the proleptic ISO calendar system
  • getValue
    Gets the year value. The year returned by this method is proleptic as per get(YEAR).
  • parse
    Obtains an instance of Year from a text string using a specific formatter. The text is parsed using
  • now
    Obtains the current year from the system clock in the specified time-zone. This will query the Clock
  • toString
    Outputs this year as a String.
  • from
    Obtains an instance of Year from a temporal object. A TemporalAccessor represents some form of date
  • isLeap
    Checks if the year is a leap year, according to the ISO proleptic calendar system rules. This method
  • atMonthDay
    Combines this year with a month-day to create a LocalDate. This returns a LocalDate formed from this
  • format
    Outputs this year as a String using the formatter. This year will be passed to the formatter DateTim
  • atMonth
    Combines this year with a month to create a YearMonth. This returns a YearMonth formed from this yea
  • compareTo
    Compares this year to another year. The comparison is based on the value of the year. It is "consist
  • plusYears
    Returns a copy of this year with the specified number of years added. This instance is immutable and
  • compareTo,
  • plusYears,
  • getLong,
  • minusYears,
  • plus,
  • <init>,
  • get,
  • length,
  • range

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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