fromTimestamp() public static method

Obtains a Clock set to to a specific point using Unix timestamp.
public static fromTimestamp ( $timestamp ) : Clock
$timestamp
return Clock
Example #1
0
 /**
  * @test
  */
 public function shouldCreateClockForGivenTimestamp()
 {
     //given
     $clock = Clock::fromTimestamp(1427207001)->setTimezone('UTC');
     //when
     $result = $clock->format();
     //then
     $this->assertEquals('2015-03-24 14:23:21', $result);
 }