本文整理了Java中org.joda.time.Instant.toInstant()
方法的一些代码示例,展示了Instant.toInstant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instant.toInstant()
方法的具体详情如下:
包路径:org.joda.time.Instant
类名称:Instant
方法名:toInstant
[英]Get this object as an Instant by returning this
.
[中]通过返回this
以即时方式获取此对象。
代码示例来源:origin: stanfordnlp/CoreNLP
public static Partial resolveWeek(Partial p)
{
// Figure out week
if (p.isSupported(DateTimeFieldType.dayOfMonth()) && p.isSupported(DateTimeFieldType.monthOfYear()) && p.isSupported(DateTimeFieldType.year())) {
Instant t = getInstant(p);
// return getPartial(t.toInstant(), p.without(DateTimeFieldType.dayOfMonth()).without(DateTimeFieldType.monthOfYear()).with(DateTimeFieldType.weekOfWeekyear(), 1));
return getPartial(t.toInstant(), p.with(DateTimeFieldType.weekOfWeekyear(), 1));
} else return p;
}
代码示例来源:origin: edu.stanford.nlp/stanford-corenlp
public static Partial resolveWeek(Partial p)
{
// Figure out week
if (p.isSupported(DateTimeFieldType.dayOfMonth()) && p.isSupported(DateTimeFieldType.monthOfYear()) && p.isSupported(DateTimeFieldType.year())) {
Instant t = getInstant(p);
// return getPartial(t.toInstant(), p.without(DateTimeFieldType.dayOfMonth()).without(DateTimeFieldType.monthOfYear()).with(DateTimeFieldType.weekOfWeekyear(), 1));
return getPartial(t.toInstant(), p.with(DateTimeFieldType.weekOfWeekyear(), 1));
} else return p;
}
代码示例来源:origin: com.guokr/stan-cn-com
public static Partial resolveWeek(Partial p)
{
// Figure out week
if (p.isSupported(DateTimeFieldType.dayOfMonth()) && p.isSupported(DateTimeFieldType.monthOfYear()) && p.isSupported(DateTimeFieldType.year())) {
Instant t = getInstant(p);
// return getPartial(t.toInstant(), p.without(DateTimeFieldType.dayOfMonth()).without(DateTimeFieldType.monthOfYear()).with(DateTimeFieldType.weekOfWeekyear(), 1));
return getPartial(t.toInstant(), p.with(DateTimeFieldType.weekOfWeekyear(), 1));
} else return p;
}
内容来源于网络,如有侵权,请联系作者删除!