====
composer install eden/timezone
====
Instantiate timezone in this manner.
$timezone = eden('timezone', time(), 'GMT');
====
====
Convert current time set here to another time zone
eden('timezone', time(), 'GMT')->convertTo(*string $zone, string|null $format);
*string $zone
- valid UTC, GMT, PHP Location or TZ Abbreviationstring|null $format
- format
Returns string|int
eden('timezone', time(), 'GMT')->convertTo('Asia/Manila');
====
Returns the GMT Format
eden('timezone', time(), 'GMT')->getGMT(string $prefix);
string $prefix
- Prefix to add before the returned value
Returns string
eden('timezone', time(), 'GMT')->getGMT();
====
Returns a list of GMT formats and dates in a 24 hour period
eden('timezone', time(), 'GMT')->getGMTDates(*string $format, int $interval, string|null $prefix);
*string $format
- The format of each date to displayint $interval
- The frequency of rowsstring|null $prefix
- The prefix to add before each date display
Returns array
eden('timezone', time(), 'GMT')->getGMTDates('F d, Y');
====
Returns the current offset of this timezone
eden('timezone', time(), 'GMT')->getOffset();
Returns int
====
Returns a list of offsets and dates in a 24 hour period
eden('timezone', time(), 'GMT')->getOffsetDates(*string $format, int $interval);
*string $format
- The format of each date to displayint $interval
- The frequency of rows
Returns array
eden('timezone', time(), 'GMT')->getOffsetDates('F d, Y');
====
Returns the time or date
eden('timezone', time(), 'GMT')->getTime(string|null $format);
string|null $format
- Time format
Returns string|int
eden('timezone', time(), 'GMT')->getTime();
====
Returns the UTC Format
eden('timezone', time(), 'GMT')->getUTC(string|null $prefix);
string|null $prefix
- The prefix to add before the returned value
Returns string
eden('timezone', time(), 'GMT')->getUTC();
====
Returns a list of UTC formats and dates in a 24 hour period
eden('timezone', time(), 'GMT')->getUTCDates(*string $format, int $interval, string|null $prefix);
*string $format
- The format of each date to displayint $interval
- The frequency of rowsstring|null $prefix
- The prefix to add before each date display
Returns array
eden('timezone', time(), 'GMT')->getUTCDates('F d, Y');
====
Returns the relative distance $time > this->time = ago
eden('timezone', time(), 'GMT')->toRelative(int|string $time, int $level, string $default);
int|string $time
- The time to make relativeint $level
- The granular levelstring $default
- The default date format
Returns Eden\Timezone\Index
eden('timezone', time(), 'GMT')->toRelative();
====
Sets a new time
eden('timezone', time(), 'GMT')->setTime(*int|string $time);
*int|string $time
- The time value
Returns Eden\Timezone\Index
eden('timezone', time(), 'GMT')->setTime(time() + 123);
====
Returns timezone's validation methods
eden('timezone', time(), 'GMT')->validation();
Returns Eden\Timezone\Index
====
Contributions to Eden are following the Github work flow. Please read up before contributing.
##Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
##Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.