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

x33g5p2x  于2022-01-20 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(206)

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

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;
 }

相关文章