java.time.Clock.withZone()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(90)

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

Clock.withZone介绍

[英]Returns a copy of this clock with a different time-zone.

A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns a clock with similar properties but using a different time-zone.
[中]返回具有不同时区的此时钟的副本。
时钟通常会获取当前时刻,然后使用时区将其转换为日期或时间。此方法返回具有类似属性但使用不同时区的时钟。

代码示例

代码示例来源:origin: neo4j/neo4j

public static DateTimeValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: neo4j/neo4j

public static TimeValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: neo4j/neo4j

public static LocalDateTimeValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: neo4j/neo4j

public static DateValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: neo4j/neo4j

public static LocalTimeValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: neo4j/neo4j

public static DateValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: neo4j/neo4j

public static LocalTimeValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: neo4j/neo4j

public static DateTimeValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: neo4j/neo4j

public static LocalDateTimeValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: neo4j/neo4j

public static TimeValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: palatable/lambda

@Override
public Clock withZone(ZoneId zone) {
  return new InstantRecordingClock(clock.withZone(zone));
}

代码示例来源:origin: org.neo4j/neo4j-values

public static LocalTimeValue now( Clock clock, Supplier<ZoneId> defaultZone )
{
  return now( clock.withZone( defaultZone.get() ) );
}

代码示例来源:origin: kpavlov/fixio

@Override
public FixClock withZone(final ZoneId zone) {
  return new FixClock(clock.withZone(zone));
}

代码示例来源:origin: Johnnei/JavaTorrent

@Override
public Clock withZone(ZoneId zone) {
  return clock.withZone(zone);
}

代码示例来源:origin: Johnnei/JavaTorrent

@Override
public Clock withZone(ZoneId zone) {
  return actualClock.withZone(zone);
}

代码示例来源:origin: org.neo4j/neo4j-values

public static DateTimeValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: org.neo4j/neo4j-values

public static DateValue now( Clock clock, String timezone )
{
  return now( clock.withZone( parseZoneName( timezone ) ) );
}

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public Clock withZone(ZoneId zone) {
  if (zone.equals(baseClock.getZone())) {  // intentional NPE
    return this;
  }
  return new OffsetClock(baseClock.withZone(zone), offset);
}
@Override

代码示例来源:origin: com.github.seratch/java-time-backport

@Override
public Clock withZone(ZoneId zone) {
  if (zone.equals(baseClock.getZone())) {  // intentional NPE
    return this;
  }
  return new TickClock(baseClock.withZone(zone), tickNanos);
}
@Override

代码示例来源:origin: EvoSuite/evosuite

@Override
public Clock withZone(ZoneId zone) {
  if (zone.equals(baseClock.getZone())) {  // intentional NPE
    return this;
  }
  return new MockClock.MockTickClock(baseClock.withZone(zone), tickNanos);
}
@Override

相关文章