本文整理了Java中org.joda.time.LocalDateTime.toLocalTime()
方法的一些代码示例,展示了LocalDateTime.toLocalTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDateTime.toLocalTime()
方法的具体详情如下:
包路径:org.joda.time.LocalDateTime
类名称:LocalDateTime
方法名:toLocalTime
[英]Converts this object to a LocalTime with the same time and chronology.
[中]将此对象转换为具有相同时间和时间顺序的LocalTime。
代码示例来源:origin: spring-projects/spring-framework
@Override
public LocalTime convert(LocalDateTime source) {
return source.toLocalTime();
}
}
代码示例来源:origin: org.springframework/spring-context
@Override
public LocalTime convert(LocalDateTime source) {
return source.toLocalTime();
}
}
代码示例来源:origin: joda-time/joda-time
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: JodaOrg/joda-time
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: alibaba/fastjson
if (text.length() == 23) {
LocalDateTime localDateTime = LocalDateTime.parse(text);
localDate = localDateTime.toLocalTime();
} else {
localDate = LocalTime.parse(text);
return (T) localDateTime.toLocalTime();
代码示例来源:origin: com.alibaba/fastjson
if (text.length() == 23) {
LocalDateTime localDateTime = LocalDateTime.parse(text);
localDate = localDateTime.toLocalTime();
} else {
localDate = LocalTime.parse(text);
return (T) localDateTime.toLocalTime();
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Parses only the local time from the given text, returning a new LocalDate.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public LocalTime convert(LocalDateTime source) {
return source.toLocalTime();
}
}
代码示例来源:origin: com.synaptix/SynaptixWidget
@Override
public Object parseObject(String source) throws ParseException {
if ((source.length() >= 1) && ((source.charAt(0) == '+') || ((source.charAt(0) == '-')))) {
return transformText(source, pattern).toLocalTime();
}
if (StringUtils.isBlank(source)) {
return null;
}
return super.parseObject(source);
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: Nextdoor/bender
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: redfish64/TinyTravelTracker
/**
* Parses only the local time from the given text, returning a new LocalDate.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/**
* Parses only the local time from the given text, returning a new LocalTime.
* <p>
* This will parse the text fully according to the formatter, using the UTC zone.
* Once parsed, only the local time will be used.
* This means that any parsed date, time-zone or offset field is completely ignored.
* It also means that the zone and offset-parsed settings are ignored.
*
* @param text the text to parse, not null
* @return the parsed time, never null
* @throws UnsupportedOperationException if parsing is not supported
* @throws IllegalArgumentException if the text to parse is invalid
* @since 2.0
*/
public LocalTime parseLocalTime(String text) {
return parseLocalDateTime(text).toLocalTime();
}
内容来源于网络,如有侵权,请联系作者删除!