Ejemplo n.º 1
0
 /**
  * Obtains a clock that returns the current instant using the best available
  * system clock, converting to date and time using the default time-zone.
  * <p>
  * This clock is based on the best available system clock.
  * This may use {@link System#currentTimeMillis()}, or a higher resolution
  * clock if one is available.
  * <p>
  * Using this method hard codes a dependency to the default time-zone into your application.
  * It is recommended to avoid this and use a specific time-zone whenever possible.
  * The {@link #systemUTC() UTC clock} should be used when you need the current instant
  * without the date or time.
  * <p>
  * The returned implementation is immutable, thread-safe and {@code Serializable}.
  * It is equivalent to {@code system(ZoneId.systemDefault())}.
  *
  * @return Clock clock that uses the best available system clock in the default zone, not null
  * @see ZoneId#systemDefault()
  */
 public static function systemDefaultZone()
 {
     return new SystemClock(ZoneId::systemDefault());
 }
Ejemplo n.º 2
0
 public function test_systemDefault()
 {
     $test = ZoneId::systemDefault();
     $this->assertEquals($test->getId(), date_default_timezone_get());
 }