本文整理了Java中org.joda.time.LocalDateTime.fromCalendarFields()
方法的一些代码示例,展示了LocalDateTime.fromCalendarFields()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDateTime.fromCalendarFields()
方法的具体详情如下:
包路径:org.joda.time.LocalDateTime
类名称:LocalDateTime
方法名:fromCalendarFields
[英]Constructs a LocalDateTime from a java.util.Calendar
using exactly the same field values.
Each field is queried from the Calendar and assigned to the LocalDateTime. This is useful if you have been using the Calendar as a local date, ignoring the zone.
One advantage of this method is that this method is unaffected if the version of the time zone data differs between the JDK and Joda-Time. That is because the local field values are transferred, calculated using the JDK time zone data and without using the Joda-Time time zone data.
This factory method ignores the type of the calendar and always creates a LocalDateTime with ISO chronology. It is expected that you will only pass in instances of GregorianCalendar
however this is not validated.
[中]
代码示例来源:origin: joda-time/joda-time
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: JodaOrg/joda-time
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: joda-time/joda-time
return fromCalendarFields(cal);
代码示例来源:origin: JodaOrg/joda-time
return fromCalendarFields(cal);
代码示例来源:origin: org.sonatype.sisu/sisu-odata4j
/**
* Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME}
*
* @param name the property name
* @param value the property value
* @return a new OData property instance
*/
public static OProperty<LocalDateTime> datetime(String name, Calendar value) {
return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? LocalDateTime.fromCalendarFields(value) : null);
}
代码示例来源:origin: odata4j/odata4j
/**
* Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME}
*
* @param name the property name
* @param value the property value
* @return a new OData property instance
*/
public static OProperty<LocalDateTime> datetime(String name, Calendar value) {
return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? LocalDateTime.fromCalendarFields(value) : null);
}
代码示例来源:origin: org.jboss.oreva/odata-core
/**
* Creates a new LocalDateTime-valued OData property with {@link EdmSimpleType#DATETIME}
*
* @param name the property name
* @param value the property value
* @return a new OData property instance
*/
public static OProperty<LocalDateTime> datetime(String name, Calendar value) {
return new Impl<LocalDateTime>(name, EdmSimpleType.DATETIME, value != null ? LocalDateTime.fromCalendarFields(value) : null);
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTime(date);
LocalDateTime check = LocalDateTime.fromCalendarFields(calendar);
if (check.isBefore(this)) {
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(calendar);
check = LocalDateTime.fromCalendarFields(earlier);
if (check.equals(this)) {
calendar = earlier;
代码示例来源:origin: joda-time/joda-time-hibernate
public Object nullSafeGet(ResultSet resultSet, String string) throws SQLException {
Object timestamp = StandardBasicTypes.TIMESTAMP.nullSafeGet(resultSet, string);
if (timestamp == null) {
return null;
}
if (timestamp instanceof Date) {
return LocalDateTime.fromDateFields((Date) timestamp);
} else if (timestamp instanceof Calendar) {
return LocalDateTime.fromCalendarFields((Calendar) timestamp);
}
return new LocalDateTime(timestamp);
}
代码示例来源:origin: JodaOrg/joda-time-hibernate
public Object nullSafeGet(ResultSet resultSet, String string) throws SQLException {
Object timestamp = StandardBasicTypes.TIMESTAMP.nullSafeGet(resultSet, string);
if (timestamp == null) {
return null;
}
if (timestamp instanceof Date) {
return LocalDateTime.fromDateFields((Date) timestamp);
} else if (timestamp instanceof Calendar) {
return LocalDateTime.fromCalendarFields((Calendar) timestamp);
}
return new LocalDateTime(timestamp);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
return fromCalendarFields(cal);
代码示例来源:origin: Nextdoor/bender
return fromCalendarFields(cal);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time
return fromCalendarFields(cal);
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
return fromCalendarFields(cal);
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
return fromCalendarFields(cal);
代码示例来源:origin: io.virtdata/virtdata-lib-realer
return fromCalendarFields(cal);
内容来源于网络,如有侵权,请联系作者删除!