src/Instant.php
public static function of(int $epochSecond, int $nanoAdjustment = 0) : Instant
    {
        $nanos = $nanoAdjustment % LocalTime::NANOS_PER_SECOND;
        $epochSecond += ($nanoAdjustment - $nanos) / LocalTime::NANOS_PER_SECOND;

        if ($nanos < 0) {
            $nanos += LocalTime::NANOS_PER_SECOND;
            $epochSecond--;
        }

        return new Instant($epochSecond, $nanos);
    }
public static function of(int $epochSecond, int $nanoAdjustment = 0) : Instant
    {
        $nanos = $nanoAdjustment % LocalTime::NANOS_PER_SECOND;
        $epochSecond += ($nanoAdjustment - $nanos) / LocalTime::NANOS_PER_SECOND;

        if ($nanos < 0) {
            $nanos += LocalTime::NANOS_PER_SECOND;
            $epochSecond--;
        }

        return new Instant($epochSecond, $nanos);
    }
public static function of ( int $ epochSecond , int $ nanoAdjustment = 0 ) : Instant { $ nanos = $ nanoAdjustment % LocalTime :: NANOS_PER_SECOND ; $ epochSecond += ( $ nanoAdjustment - $ nanos ) / LocalTime :: NANOS_PER_SECOND ; if ( $ nanos < 0 ) { $ nanos += LocalTime :: NANOS_PER_SECOND ; $ epochSecond -- ; } return new Instant ( $ epochSecond , $ nanos ) ; }
Returns an Instant representing a number of seconds and an adjustment in nanoseconds.

This method allows an arbitrary number of nanoseconds to be passed in.
The factory will alter the values of the second and nanosecond in order
to ensure that the stored nanosecond is in the range 0 to 999,999,999.
For example, the following will result in the exactly the same duration:

* Instant::of(3, 1);
* Duration::of(4, -999999999);
* Duration::of(2, 1000000001);

@param int $epochSecond    The number of seconds since the UNIX epoch of 1970-01-01T00:00:00Z.
@param int $nanoAdjustment The adjustment to the epoch second in nanoseconds.

@return Instant
Returns an Instant representing a number of seconds and an adjustment in nanoseconds .