Tabnine Logo
Year.atMonth
Code IndexAdd Tabnine to your IDE (free)

How to use
atMonth
method
in
java.time.Year

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

origin: org.codehaus.groovy/groovy-datetime

/**
 * Returns a {@link java.time.YearMonth} of this year and the provided {@link java.time.Month}.
 *
 * @param self  a Year
 * @param month a Month
 * @return a YearMonth
 * @since 2.5.0
 */
public static YearMonth leftShift(final Year self, Month month) {
  return self.atMonth(month);
}
origin: org.codehaus.groovy/groovy-datetime

/**
 * Converts the Calendar to a corresponding {@link java.time.YearMonth}. If the Calendar has a different
 * time zone than the system default, the YearMonth will be adjusted into the default time zone.
 *
 * @param self a Calendar
 * @return a YearMonth
 * @since 2.5.0
 */
public static YearMonth toYearMonth(final Calendar self) {
  return toYear(self).atMonth(toMonth(self));
}
origin: stackoverflow.com

return year.atMonth(month)
    .atDay(1)
    .atStartOfDay()
return year.atMonth(month)
    .atEndOfMonth()
    .atTime(LocalTime.MAX)
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: arnaudroger/SimpleFlatMapper

@Test
public void testObjectToYear() throws Exception {
  ZoneId zoneId = ZoneId.systemDefault();
  Date now = new Date();
  Year year = Year.from(now.toInstant().atZone(zoneId));
  testObjectToYear(null, null);
  testObjectToYear(year, year);
  testObjectToYear(year.atMonth(6).atEndOfMonth().atTime(1, 0).atZone(zoneId), year);
  testObjectToYear(now, year);
  testObjectToYear(year.getValue(), year);
  try {
    testObjectToYear("a string", year);
    fail();
  } catch (IllegalArgumentException e) {
    // expected
  }
}
java.timeYearatMonth

Javadoc

Combines this year with a month to create a YearMonth.

This returns a YearMonth formed from this year and the specified month. All possible combinations of year and month are valid.

This method can be used as part of a chain to produce a date:

 
LocalDate date = year.atMonth(month).atDay(day); 

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.
  • atDay
    Combines this year with a day-of-year to create a LocalDate. This returns a LocalDate formed from th
  • 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
  • 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

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • From CI to AI: The AI layer in your organization
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