Core\Moment moment( [int $seconds] )
Provides methods that are part of our cores Moment class that deals with time related functions.
$seconds
Shorthand call to toString() method, which converts UNIX time to human readable time stamps.
<?php route('/foo', function() { // Prints the current UNIX time stamp $time = moment()->now(); echo $time; // Converts a UNIX time stamp to human readable time (e.g 1 second ago) echo moment()->toString($time); /** * Short hand of the toString() method */ echo moment($time); }); |
Method | Description | Usage | Returns | |
---|---|---|---|---|
now()
| Get the current UNIX time stamp. |
| Returns current UNIX time stamp. | |
toString(int $seconds)
$seconds UNIX time stamp | Converts a UNIX time stamp to human readable |
| Examples based on time stamp...
|