- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中net.time4j.tz.ZonalOffset.getFractionalAmount()
方法的一些代码示例,展示了ZonalOffset.getFractionalAmount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonalOffset.getFractionalAmount()
方法的具体详情如下:
包路径:net.time4j.tz.ZonalOffset
类名称:ZonalOffset
方法名:getFractionalAmount
[英]Returns the fractional second part of this shift in nanoseconds.
Only longitudinal offsets may have fractional parts.
[中]以纳秒为单位返回此移位的小数秒部分。
只有纵向偏移可以包含小数部分。
代码示例来源:origin: net.time4j/time4j-core
/**
* @serialData Checks the consistency.
* @param in object input stream
* @throws InvalidObjectException in case of inconsistencies
* @throws ClassNotFoundException if class-loading fails
*/
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
if (this.offset.getFractionalAmount() != 0) {
throw new InvalidObjectException("Fractional offset is invalid.");
}
}
代码示例来源:origin: net.time4j/time4j-core
private void writeOffset(ObjectOutput out)
throws IOException {
ZonalOffset offset = (ZonalOffset) this.obj;
boolean hasFraction = (offset.getFractionalAmount() != 0);
int header = (ZONAL_OFFSET_TYPE << 4);
if (hasFraction) {
header |= 1;
}
out.writeByte(header);
out.writeInt(offset.getIntegralAmount());
if (hasFraction) {
out.writeInt(offset.getFractionalAmount());
}
}
代码示例来源:origin: net.time4j/time4j-core
private SingleOffsetTimezone(ZonalOffset offset) {
super();
if (offset.getFractionalAmount() == 0) {
this.offset = offset;
} else {
int total = offset.getIntegralAmount();
if (offset.getFractionalAmount() < 0) {
total--; // corresponding to floor-divide-algorithm
}
this.offset = ZonalOffset.ofTotalSeconds(total);
}
}
代码示例来源:origin: net.time4j/time4j-range
private RecurrentMomentIntervals(
int count,
int type,
PlainTimestamp ref,
ZonalOffset offset,
Duration<?> duration
) {
super(count, type);
this.ref = ref;
this.offset = offset;
this.duration = duration;
if (!duration.isPositive()) {
throw new IllegalArgumentException("Duration must be positive: " + duration);
} else if ((offset.getIntegralAmount() % 60 != 0) || (offset.getFractionalAmount() != 0)) {
throw new IllegalArgumentException("Offset with seconds is invalid in ISO-8601: " + offset);
}
}
代码示例来源:origin: net.time4j/time4j-core
private static boolean isNonIsoOffset(
Timezone timezone,
Moment context
) {
ZonalOffset offset = timezone.getOffset(context);
return (
(offset.getFractionalAmount() != 0)
|| ((offset.getAbsoluteSeconds() % 60) != 0)
);
}
代码示例来源:origin: net.time4j/time4j-range
private String getOffsetAsString() {
if ((this.offset.getIntegralAmount() == 0) && (this.offset.getFractionalAmount() == 0)) {
return "Z";
}
return this.offset.toString();
}
代码示例来源:origin: net.time4j/time4j-core
/**
* <p>Fabrikmethode. </p>
*
* @param offset fixed shift of local time relative to UTC in seconds
*/
static SingleOffsetTimezone of(ZonalOffset offset) {
if (
(offset.getIntegralAmount() == 0)
&& (offset.getFractionalAmount() == 0)
) {
return UTC;
} else {
return new SingleOffsetTimezone(offset);
}
}
代码示例来源:origin: net.time4j/time4j-core
@Override
public V apply(Moment context) {
ZonalOffset shift = (
(this.offset == null)
? this.tz.getOffset(context)
: this.offset);
if (
(this.element == PlainTime.SECOND_OF_MINUTE)
&& context.isLeapSecond()
&& (shift.getFractionalAmount() == 0)
&& ((shift.getAbsoluteSeconds() % 60) == 0)
) {
return this.element.getType().cast(Integer.valueOf(60));
}
return PlainTimestamp.from(context, shift).get(this.element);
}
代码示例来源:origin: net.time4j/time4j-core
private ZonalDateTime(
Moment moment,
Timezone tz
) {
super();
this.zone = tz;
ZonalOffset offset = tz.getOffset(moment);
if (moment.isLeapSecond()) {
if (
(offset.getFractionalAmount() != 0)
|| ((offset.getAbsoluteSeconds() % 60) != 0)
) {
throw new IllegalArgumentException(
"Leap second can only be represented "
+ " with timezone-offset in full minutes: "
+ offset);
}
}
this.moment = moment;
this.timestamp = PlainTimestamp.from(moment, offset);
}
代码示例来源:origin: net.time4j/time4j-core
int localNanos = ut.getNanosecond() + offset.getFractionalAmount();
代码示例来源:origin: net.time4j/time4j-core
int localNanos = ut.getNanosecond() + offset.getFractionalAmount();
代码示例来源:origin: net.time4j/time4j-core
/**
* <p>Erzeugt ein neues Datum passend zur angegebenen absoluten Zeit. </p>
*
* @param ut unix time
* @param offset shift of local time relative to UTC
* @return new calendar date
*/
static PlainDate from(
UnixTime ut,
ZonalOffset offset
) {
long localSeconds = ut.getPosixTime() + offset.getIntegralAmount();
int localNanos = ut.getNanosecond() + offset.getFractionalAmount();
if (localNanos < 0) {
localSeconds--;
} else if (localNanos >= 1000000000) {
localSeconds++;
}
long mjd =
EpochDays.MODIFIED_JULIAN_DATE.transform(
MathUtils.floorDivide(localSeconds, 86400),
EpochDays.UNIX);
long packedDate = GregorianMath.toPackedDate(mjd);
return PlainDate.of(
GregorianMath.readYear(packedDate),
GregorianMath.readMonth(packedDate),
GregorianMath.readDayOfMonth(packedDate)
);
}
代码示例来源:origin: net.time4j/time4j-core
int posixNanos = localNanos - offset.getFractionalAmount();
代码示例来源:origin: net.time4j/time4j-core
(offset.getFractionalAmount() != 0)
|| ((offset.getAbsoluteSeconds() % 60) != 0)
) {
本文整理了Java中net.time4j.tz.ZonalOffset.ofTotalSeconds()方法的一些代码示例,展示了ZonalOffset.ofTotalSeconds()的具体用法。这
本文整理了Java中net.time4j.tz.ZonalOffset.equals()方法的一些代码示例,展示了ZonalOffset.equals()的具体用法。这些代码示例主要来源于Github
本文整理了Java中net.time4j.tz.ZonalOffset.parse()方法的一些代码示例,展示了ZonalOffset.parse()的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中net.time4j.tz.ZonalOffset.toString()方法的一些代码示例,展示了ZonalOffset.toString()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中net.time4j.tz.ZonalOffset.getFractionalAmount()方法的一些代码示例,展示了ZonalOffset.getFractionalAmoun
本文整理了Java中net.time4j.tz.ZonalOffset.getIntegralAmount()方法的一些代码示例,展示了ZonalOffset.getIntegralAmount()的
本文整理了Java中net.time4j.tz.ZonalOffset.hashCode()方法的一些代码示例,展示了ZonalOffset.hashCode()的具体用法。这些代码示例主要来源于Gi
我是一名优秀的程序员,十分优秀!