本文整理了Java中org.threeten.bp.LocalDateTime.toInstant()
方法的一些代码示例,展示了LocalDateTime.toInstant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDateTime.toInstant()
方法的具体详情如下:
包路径:org.threeten.bp.LocalDateTime
类名称:LocalDateTime
方法名:toInstant
暂无
代码示例来源:origin: ThreeTen/threetenbp
/**
* Converts this date-time to an {@code Instant}.
*
* @return an {@code Instant} representing the same instant, not null
*/
public Instant toInstant() {
return dateTime.toInstant(offset);
}
代码示例来源:origin: org.threeten/threetenbp
/**
* Converts this date-time to an {@code Instant}.
*
* @return an {@code Instant} representing the same instant, not null
*/
public Instant toInstant() {
return dateTime.toInstant(offset);
}
代码示例来源:origin: ThreeTen/threetenbp
/**
* Gets the transition instant.
* <p>
* This is the instant of the discontinuity, which is defined as the first
* instant that the 'after' offset applies.
* <p>
* The methods {@link #getInstant()}, {@link #getDateTimeBefore()} and {@link #getDateTimeAfter()}
* all represent the same instant.
*
* @return the transition instant, not null
*/
public Instant getInstant() {
return transition.toInstant(offsetBefore);
}
代码示例来源:origin: org.threeten/threetenbp
/**
* Gets the transition instant.
* <p>
* This is the instant of the discontinuity, which is defined as the first
* instant that the 'after' offset applies.
* <p>
* The methods {@link #getInstant()}, {@link #getDateTimeBefore()} and {@link #getDateTimeAfter()}
* all represent the same instant.
*
* @return the transition instant, not null
*/
public Instant getInstant() {
return transition.toInstant(offsetBefore);
}
代码示例来源:origin: jeffdcamp/dbtools-android
@Nullable
public static Long localDateTimeToLongUtc(@Nullable LocalDateTime d) {
if (d == null) {
return null;
}
return d.toInstant(ZoneOffset.UTC).toEpochMilli();
}
代码示例来源:origin: com.torodb.kvdocument/mongo-converter
@Override
public BsonValue visit(DateValue value, Void arg) {
Instant instant = value.getValue().atStartOfDay().toInstant(ZoneOffset.UTC);
return new BsonDateTime(instant.toEpochMilli());
}
代码示例来源:origin: com.torodb.kvdocument/mongo-converter
@Override
public BsonValue visit(DateTimeValue value, Void arg) {
Instant instant = value.getValue().toInstant(ZoneOffset.UTC);
return new BsonTimestamp(
UnsignedInteger.valueOf(instant.getEpochSecond()).intValue(),
instant.getNano()
);
}
内容来源于网络,如有侵权,请联系作者删除!