org.joda.time.DateTime.getYearOfCentury()方法的使用及代码示例

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

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

DateTime.getYearOfCentury介绍

暂无

代码示例

代码示例来源:origin: org.modeshape/modeshape-graph

/**
 * {@inheritDoc}
 */
public int getYearOfCentury() {
  return this.instance.getYearOfCentury();
}

代码示例来源:origin: com.github.Alex-2713-GitHub/alex-cloud-framework-date

/**
 * findYear 获取年
 * @param dateTime dateTime日期时间
 * @return 月份 如 1 代表一月
 */
public static int findYear(DateTime dateTime) {
  int yearOfCentury = dateTime.getYearOfCentury();
  return yearOfCentury;
}

代码示例来源:origin: io.codearte.jfairy/jfairy

public String getExpiryDateAsString() {
    return String.format("%02d/%02d", expiryDate.getMonthOfYear(), expiryDate.getYearOfCentury());
  }
}

代码示例来源:origin: io.codearte.jfairy/jfairy

private String generate() {
  int year = issueDate.getYearOfCentury();
  int month = issueDate.getMonthOfYear();
  int day = issueDate.getDayOfMonth();
  int serialNumber = baseProducer.randomInt(MAX_SERIAL_NUMBER);
  int sexCode = calculateSexCode(sex);
  String nationalIdentificationNumber = format("%02d%02d%02d-%02d%d", year, month, day, serialNumber, sexCode);
  return nationalIdentificationNumber + calculateChecksum(nationalIdentificationNumber);
}

代码示例来源:origin: io.codearte.jfairy/jfairy

private String generate() {
  int year = issueDate.getYearOfCentury();
  int month = calculateMonth(issueDate.getMonthOfYear(), issueDate.getYear());
  int day = issueDate.getDayOfMonth();
  int serialNumber = baseProducer.randomInt(MAX_SERIAL_NUMBER);
  int sexCode = calculateSexCode(sex);
  String nationalIdentificationNumber = format("%02d%02d%02d%03d%d", year, month, day, serialNumber, sexCode);
  return nationalIdentificationNumber + calculateChecksum(nationalIdentificationNumber);
}

代码示例来源:origin: addthis/hydra

@Override
public String getFormattedDateString(long timeMillis) {
  // For better handling of days at the end of the year.
  DateTime dt = new DateTime(timeMillis);
  if (dt.monthOfYear().get() == 12 && dt.weekOfWeekyear().get() < 3) {
    return dt.getYearOfCentury() + "53";
  }
  return Integer.toString(dt.weekyear().get() % 1000) + String.format("%02d", dt.weekOfWeekyear().get());
}

代码示例来源:origin: jvelo/mayocat-shop

@Override
public synchronized InvoiceNumber getOrCreateInvoiceNumber(Order order) throws InvoicingException
{
  this.dao.begin();
  InvoiceNumber existing = this.dao.findForOrderId(order.getId());
  if (existing != null) {
    this.dao.commit();
    return existing;
  }
  DateTime dateTime = new DateTime();
  int weekOfYear = dateTime.getWeekOfWeekyear();
  int year = dateTime.getYearOfCentury();
  String prefix = String.format("%02d%02d", year, weekOfYear);
  Integer previousCountForPrefix = this.dao.getCountForPrefix(prefix);
  String number = prefix + String.format("%03d", ++previousCountForPrefix);
  InvoiceNumber generated = new InvoiceNumber(order.getId(), number, new Date());
  this.dao.createInvoiceNumber(generated);
  this.dao.commit();
  return generated;
}

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

break;
case 'y':
  sb.append(dt.getYearOfCentury());
  break;
case 'L':
  sb.append(dt.getYearOfCentury() % 4 == 0 ? 1 : 0);
  break;

代码示例来源:origin: itesla/ipst

+ String.format("%02d", n.getCaseDate().getYearOfCentury());
String originatorName = n.getSourceFormat();
double baseMVA = defaultBaseMVA;

代码示例来源:origin: infiniteautomation/ma-core-public

time = time.minusYears(time.getYearOfCentury() % periods);
time = time.dayOfYear().withMinimumValue();
time = time.withTimeAtStartOfDay();

相关文章

DateTime类方法