gpt4 book ai didi

cesiumlanguagewriter.YearMonthDay.getMonth()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 14:35:31 30 4
gpt4 key购买 nike

本文整理了Java中cesiumlanguagewriter.YearMonthDay.getMonth()方法的一些代码示例,展示了YearMonthDay.getMonth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDay.getMonth()方法的具体详情如下:
包路径:cesiumlanguagewriter.YearMonthDay
类名称:YearMonthDay
方法名:getMonth

YearMonthDay.getMonth介绍

[英]Gets the month of the year (in the range 1 through 12).
[中]

代码示例

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  Gets the month of the year (in the range 1 through 12).

*/
public final int getMonth() {
  return m_yearMonthDay.getMonth();
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  Gets the Julian day number for this {@link YearMonthDay} instance,
assuming noon on this day.

*/
public final int getJulianDayNumber() {
  // Algorithm from page 604 of the Explanatory Supplement to the
  // Astronomical Almanac (Seidelmann 1992).
  int a = (getMonth() - 14) / 12;
  int b = getYear() + 4800 + a;
  return 1461 * b / 4 + 367 * (getMonth() - 2 - 12 * a) / 12 - 3 * ((b + 100) / 100) / 4 + getDay() - 32075;
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  Gets the day of the week represented by this instance.

* @return A {@code DayOfWeek} ({@link #getDayOfWeek get}) enumerated constant that indicates the day
of the week. This property value ranges from zero, indicating Sunday, to six,
indicating Saturday.
*/
@Nonnull
public final DayOfWeek getDayOfWeek() {
  return DateTimeHelper.create(getYear(), getMonth(), getDay()).getDayOfWeek();
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Returns a string formatted as Year:Month:Day

* @return The string.
*/
@Override
public String toString() {
  return StringHelper.format(CultureInfoHelper.getCurrentCulture(), "{0}:{1}:{2}", getYear(), getMonth(), getDay());
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
* Convert this {@link GregorianDate} to a {@link ZonedDateTime}.
The {@link ZonedDateTime} will be in UTC.
* @return A {@link ZonedDateTime} representing this date.
*/
@CS2JWarning("Unhandled attribute removed: Pure")
@Nonnull
public final ZonedDateTime toDateTime() {
  ZonedDateTime date = DateTimeHelper.create(m_yearMonthDay.getYear(), m_yearMonthDay.getMonth(), m_yearMonthDay.getDay());
  final long ticksPerHour = 36000000000L;
  final long ticksPerMinute = 600000000L;
  final long ticksPerSecond = 10000000L;
  long ticks = DateTimeHelper.getTicks(date);
  ticks += m_hour * ticksPerHour;
  ticks += m_minute * ticksPerMinute;
  ticks += (long) Math.rint(m_second * ticksPerSecond);
  return DateTimeHelper.create(ticks, ZoneOffset.UTC);
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

if (!isValid(year, yearMonthDay.getMonth(), yearMonthDay.getDay(), hour, minute, second)) {
  throw new ArgumentException(CesiumLocalization.getHourMinuteSecondInvalidArgument());

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Tests that initialization of and access to the structure elements is performed correctly.

*/
@Test
public final void testRetainValue() {
  YearMonthDay date = new YearMonthDay(2000, 1, 1);
  Assert.assertEquals((int) 2000, (int) date.getYear());
  Assert.assertEquals((int) 1, (int) date.getMonth());
  Assert.assertEquals((int) 1, (int) date.getDay());
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

/**
*  
Tests the constructor overload that takes a {@link JulianDate}.

*/
@Test
public final void testConstructFromJulianDate() {
  ZonedDateTime dt = DateTimeHelper.create(2008, 10, 23, 12, 0, 0);
  JulianDate jd = new JulianDate(dt);
  YearMonthDay ymd = new YearMonthDay(jd);
  Assert.assertEquals((int) 2008, (int) ymd.getYear());
  Assert.assertEquals((int) 10, (int) ymd.getMonth());
  Assert.assertEquals((int) 23, (int) ymd.getDay());
  dt = DateTimeHelper.create(2008, 10, 23, 0, 0, 0);
  jd = new JulianDate(dt);
  ymd = new YearMonthDay(jd);
  Assert.assertEquals((int) 2008, (int) ymd.getYear());
  Assert.assertEquals((int) 10, (int) ymd.getMonth());
  Assert.assertEquals((int) 23, (int) ymd.getDay());
  dt = DateTimeHelper.create(2008, 10, 23, 23, 59, 59);
  jd = new JulianDate(dt);
  ymd = new YearMonthDay(jd);
  Assert.assertEquals((int) 2008, (int) ymd.getYear());
  Assert.assertEquals((int) 10, (int) ymd.getMonth());
  Assert.assertEquals((int) 23, (int) ymd.getDay());
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

@Test
public final void testDefaultConstructedIsValid() {
  YearMonthDay ymd = new YearMonthDay();
  YearMonthDay ymd2 = new YearMonthDay(ymd.getYear(), ymd.getMonth(), ymd.getDay());
  AssertHelper.assertEquals(ymd, ymd2);
  AssertHelper.assertEquals(ymd.getDayOfWeek(), ymd2.getDayOfWeek());
  Assert.assertEquals((int) ymd.getDayOfYear(), (int) ymd2.getDayOfYear());
}

代码示例来源:origin: AnalyticalGraphicsInc/czml-writer

Assert.assertEquals((int) month, (int) ymd.getMonth());
Assert.assertEquals((int) 1, (int) ymd.getDay());
int daysInMonth = YearMonthDay.daysInMonth(year, month);
Assert.assertEquals((int) month, (int) ymd.getMonth());
Assert.assertEquals((int) daysInMonth, (int) ymd.getDay());
cumulativeDays += daysInMonth;

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com