Skip to content

Commit

Permalink
dateObject::createFromTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
JanHuang committed Apr 21, 2017
1 parent 7130182 commit a83a7de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/DateObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
*/
class DateObject extends DateTime
{
/**
* @param $timestamp
* @return static
*/
public static function createFromTimestamp($timestamp)
{
return new static(date('Y-m-d H:i:s', $timestamp));
}

/**
* @return string
*/
Expand Down

0 comments on commit a83a7de

Please sign in to comment.