java.util.Calendar.getWeekYear()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(338)

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

Calendar.getWeekYear介绍

[英]Returns the week year represented by this Calendar. The week year is in sync with the week cycle. The #getFirstDayOfWeek() is the first day of the week year.

The default implementation of this method throws an UnsupportedOperationException.
[中]返回此日历表示的周和年。周-年与周周期同步。getFirstDayOfWeek()是一周中的第一天。
此方法的默认实现引发UnsupportedOperationException。

代码示例

代码示例来源:origin: org.apache.commons/commons-lang3

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: looly/hutool

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: looly/hutool

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: stackoverflow.com

Calendar calendar = new GregorianCalendar(Locale.GERMAN);
calendar.set(2016, Calendar.JANUARY, 1, 0, 0, 0);
Date date = calendar.getTime();

int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);
int year       = calendar.getWeekYear();

System.out.println(date + " is in " + weekOfYear + " of " + year);

代码示例来源:origin: stackoverflow.com

SimpleDateFormat sdf = new SimpleDateFormat("yyyy");    
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));    
System.out.println(calendar.getWeekYear());

代码示例来源:origin: com.aliyun.openservices/ons-client

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: de.knightsoft-net/gwt-commons-lang3

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: com.xiaoleilu/hutool

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: com.ailyr/lyr-tool-core

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: cn.hutool/hutool-all

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: com.xiaoleilu/hutool-core

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: io.virtdata/virtdata-lib-curves4

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException {
  mRule.appendTo(buffer, calendar.getWeekYear());
}

代码示例来源:origin: stackoverflow.com

Calendar c = Calendar.getInstance();
c.setFirstDayOfWeek(Calendar.MONDAY);
c.set(2016, 08, 01);

Calendar start = Calendar.getInstance();
start.setFirstDayOfWeek(Calendar.MONDAY);
start.setWeekDate(2016,c.getWeekYear(), Calendar.MONDAY);

代码示例来源:origin: EvoSuite/evosuite

public int getWeekYear() {
  Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, "getWeekYear", "()I", new Object[] {});
  int ret = wrappedCalendar.getWeekYear();
  Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, ret);
  return ret;
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

if (field == CalendarBuilder.WEEK_YEAR) {
  if (calendar.isWeekDateSupported()) {
    value = calendar.getWeekYear();
  } else {

代码示例来源:origin: jtulach/bck2brwsr

if (field == CalendarBuilder.WEEK_YEAR) {
  if (calendar.isWeekDateSupported()) {
    value = calendar.getWeekYear();
  } else {

相关文章