本文整理汇总了Java中org.threeten.bp.ZonedDateTime.toInstant方法的典型用法代码示例。如果您正苦于以下问题:Java ZonedDateTime.toInstant方法的具体用法?Java ZonedDateTime.toInstant怎么用?Java ZonedDateTime.toInstant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threeten.bp.ZonedDateTime
的用法示例。
在下文中一共展示了ZonedDateTime.toInstant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CompiledFunction
import org.threeten.bp.ZonedDateTime; //导入方法依赖的package包/类
/**
* @param from Earliest time that the invoker is valid
* @param to Latest time that the invoker is valid
* @param now The valuation time
* @param definitionSource The volatility surface definition source
* @param specificationSource The volatility surface specification source
*/
public CompiledFunction(final ZonedDateTime from, final ZonedDateTime to, final ZonedDateTime now, final ConfigDBVolatilitySurfaceDefinitionSource definitionSource,
final ConfigDBVolatilitySurfaceSpecificationSource specificationSource) {
super(from.toInstant(), to.toInstant());
_now = now;
_definitionSource = definitionSource;
_specificationSource = specificationSource;
}
示例2: getDateOffsetWithYearFraction
import org.threeten.bp.ZonedDateTime; //导入方法依赖的package包/类
/**
* Method that allows a fraction of a year to be added to a date. If the yearFraction that is used does not give an integer number of seconds, it is rounded to the nearest nanosecond. Note that the
* number of days in a year is defined to be 365.25.
*
* @param startDate the start date, not null
* @param yearFraction the fraction of a year
* @return the calculated date-time, not null
* @throws IllegalArgumentException if the date is null
*/
public static ZonedDateTime getDateOffsetWithYearFraction(final ZonedDateTime startDate, final double yearFraction) {
if (startDate == null) {
throw new IllegalArgumentException("Date was null");
}
final Instant instant = startDate.toInstant();
final Instant offsetDate = getDateOffsetWithYearFraction(instant, yearFraction);
return ZonedDateTime.ofInstant(offsetDate, startDate.getZone());
}
示例3: AbstractInvokingCompiledFunction
import org.threeten.bp.ZonedDateTime; //导入方法依赖的package包/类
/**
* Creates an instance.
*
* @param earliestInvocation earliest time this metadata and invoker are valid, null to indicate no lower validity bound
* @param latestInvocation latest time this metadata and invoker are valid, null to indicate no upper validity bound
*/
protected AbstractInvokingCompiledFunction(final ZonedDateTime earliestInvocation, final ZonedDateTime latestInvocation) {
super(earliestInvocation.toInstant(), latestInvocation.toInstant());
}