本文整理了Java中org.joda.time.LocalDate.getLocalMillis()
方法的一些代码示例,展示了LocalDate.getLocalMillis()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDate.getLocalMillis()
方法的具体详情如下:
包路径:org.joda.time.LocalDate
类名称:LocalDate
方法名:getLocalMillis
[英]Gets the local milliseconds from the Java epoch of 1970-01-01T00:00:00 (not fixed to any specific time zone).
[中]获取Java纪元1970-01-01T00:00:00(不固定到任何特定时区)的本地毫秒数。
代码示例来源:origin: joda-time/joda-time
/**
* Rounds to the nearest whole unit of this field on a copy of this
* LocalDate. If halfway, the ceiling is favored over the floor
* only if it makes this field's value even.
*
* @return a copy of the LocalDate with the field value changed
*/
public LocalDate roundHalfEvenCopy() {
return iInstant.withLocalMillis(iField.roundHalfEven(iInstant.getLocalMillis()));
}
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the partial set of fields replacing
* those from this instance.
* <p>
* For example, if the partial contains a year and a month then those two
* fields will be changed in the returned instance.
* Unsupported fields are ignored.
* If the partial is null, then <code>this</code> is returned.
*
* @param partial the partial set of fields to apply to this date, null ignored
* @return a copy of this date with a different set of fields
* @throws IllegalArgumentException if any value is invalid
*/
public LocalDate withFields(ReadablePartial partial) {
if (partial == null) {
return this;
}
return withLocalMillis(getChronology().set(partial, getLocalMillis()));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the year of century field value.
*
* @return the year of century
*/
public int getYearOfCentury() {
return getChronology().yearOfCentury().get(getLocalMillis());
}
代码示例来源:origin: JodaOrg/joda-time
/**
* Returns a copy of this date with the partial set of fields replacing
* those from this instance.
* <p>
* For example, if the partial contains a year and a month then those two
* fields will be changed in the returned instance.
* Unsupported fields are ignored.
* If the partial is null, then <code>this</code> is returned.
*
* @param partial the partial set of fields to apply to this date, null ignored
* @return a copy of this date with a different set of fields
* @throws IllegalArgumentException if any value is invalid
*/
public LocalDate withFields(ReadablePartial partial) {
if (partial == null) {
return this;
}
return withLocalMillis(getChronology().set(partial, getLocalMillis()));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the day of month field value.
* <p>
* The values for the day of month are defined in {@link org.joda.time.DateTimeConstants}.
*
* @return the day of month
*/
public int getDayOfMonth() {
return getChronology().dayOfMonth().get(getLocalMillis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Sets this field in a copy of the LocalDate.
* <p>
* The LocalDate attached to this property is unchanged by this call.
*
* @param value the value to set the field in the copy to
* @return a copy of the LocalDate with the field value changed
* @throws IllegalArgumentException if the value isn't valid
*/
public LocalDate setCopy(int value) {
return iInstant.withLocalMillis(iField.set(iInstant.getLocalMillis(), value));
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the era field updated.
* <p>
* LocalDate is immutable, so there are no set methods.
* Instead, this method returns a new instance with the value of
* era changed.
*
* @param era the era to set
* @return a copy of this object with the field set
* @throws IllegalArgumentException if the value is invalid
*/
public LocalDate withEra(int era) {
return withLocalMillis(getChronology().era().set(getLocalMillis(), era));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the era field value.
*
* @return the era
*/
public int getEra() {
return getChronology().era().get(getLocalMillis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Adds to this field in a copy of this LocalDate.
* <p>
* The LocalDate attached to this property is unchanged by this call.
*
* @param value the value to add to the field in the copy
* @return a copy of the LocalDate with the field value changed
* @throws IllegalArgumentException if the value isn't valid
*/
public LocalDate addToCopy(int value) {
return iInstant.withLocalMillis(iField.add(iInstant.getLocalMillis(), value));
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the year field updated.
* <p>
* LocalDate is immutable, so there are no set methods.
* Instead, this method returns a new instance with the value of
* year changed.
*
* @param year the year to set
* @return a copy of this object with the field set
* @throws IllegalArgumentException if the value is invalid
*/
public LocalDate withYear(int year) {
return withLocalMillis(getChronology().year().set(getLocalMillis(), year));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the year field value.
*
* @return the year
*/
public int getYear() {
return getChronology().year().get(getLocalMillis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Rounds to the nearest whole unit of this field on a copy of this
* LocalDate, favoring the floor if halfway.
*
* @return a copy of the LocalDate with the field value changed
*/
public LocalDate roundHalfFloorCopy() {
return iInstant.withLocalMillis(iField.roundHalfFloor(iInstant.getLocalMillis()));
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the day of year field updated.
* <p>
* LocalDate is immutable, so there are no set methods.
* Instead, this method returns a new instance with the value of
* day of year changed.
*
* @param dayOfYear the day of year to set
* @return a copy of this object with the field set
* @throws IllegalArgumentException if the value is invalid
*/
public LocalDate withDayOfYear(int dayOfYear) {
return withLocalMillis(getChronology().dayOfYear().set(getLocalMillis(), dayOfYear));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the year of era field value.
*
* @return the year of era
*/
public int getYearOfEra() {
return getChronology().yearOfEra().get(getLocalMillis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Rounds to the nearest whole unit of this field on a copy of this
* LocalDate, favoring the ceiling if halfway.
*
* @return a copy of the LocalDate with the field value changed
*/
public LocalDate roundHalfCeilingCopy() {
return iInstant.withLocalMillis(iField.roundHalfCeiling(iInstant.getLocalMillis()));
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the day of month field updated.
* <p>
* LocalDate is immutable, so there are no set methods.
* Instead, this method returns a new instance with the value of
* day of month changed.
*
* @param dayOfMonth the day of month to set
* @return a copy of this object with the field set
* @throws IllegalArgumentException if the value is invalid
*/
public LocalDate withDayOfMonth(int dayOfMonth) {
return withLocalMillis(getChronology().dayOfMonth().set(getLocalMillis(), dayOfMonth));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the month of year field value.
*
* @return the month of year
*/
public int getMonthOfYear() {
return getChronology().monthOfYear().get(getLocalMillis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Rounds to the highest whole unit of this field on a copy of this
* LocalDate.
* <p>
* For example, rounding floor on the hourOfDay field of a LocalDate
* where the time is 10:30 would result in new LocalDate with the
* time of 11:00.
*
* @return a copy of the LocalDate with the field value changed
*/
public LocalDate roundCeilingCopy() {
return iInstant.withLocalMillis(iField.roundCeiling(iInstant.getLocalMillis()));
}
代码示例来源:origin: joda-time/joda-time
/**
* Returns a copy of this date with the year of era field updated.
* <p>
* LocalDate is immutable, so there are no set methods.
* Instead, this method returns a new instance with the value of
* year of era changed.
*
* @param yearOfEra the year of era to set
* @return a copy of this object with the field set
* @throws IllegalArgumentException if the value is invalid
*/
public LocalDate withYearOfEra(int yearOfEra) {
return withLocalMillis(getChronology().yearOfEra().set(getLocalMillis(), yearOfEra));
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the year of era field value.
*
* @return the year of era
*/
public int getCenturyOfEra() {
return getChronology().centuryOfEra().get(getLocalMillis());
}
内容来源于网络,如有侵权,请联系作者删除!