2017-25 © Pedro Peláez
 

library timezone

Eden timezone component.

image

eden/timezone

Eden timezone component.

  • Friday, November 13, 2015
  • by cblanquera
  • Repository
  • 14 Watchers
  • 0 Stars
  • 8,147 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

logo Eden Timezone

Build Status

====, (*1)

, (*2)

Install

composer install eden/timezone, (*3)

====, (*4)

, (*5)

Introduction

Instantiate timezone in this manner., (*6)

$timezone = eden('timezone', time(), 'GMT');

====, (*7)

, (*8)

API

====, (*9)

, (*10)

convertTo

Convert current time set here to another time zone, (*11)

Usage

eden('timezone', time(), 'GMT')->convertTo(*string $zone, string|null $format);

Parameters

  • *string $zone - valid UTC, GMT, PHP Location or TZ Abbreviation
  • string|null $format - format

Returns string|int, (*12)

Example

eden('timezone', time(), 'GMT')->convertTo('Asia/Manila');

====, (*13)

, (*14)

getGMT

Returns the GMT Format, (*15)

Usage

eden('timezone', time(), 'GMT')->getGMT(string $prefix);

Parameters

  • string $prefix - Prefix to add before the returned value

Returns string, (*16)

Example

eden('timezone', time(), 'GMT')->getGMT();

====, (*17)

, (*18)

getGMTDates

Returns a list of GMT formats and dates in a 24 hour period, (*19)

Usage

eden('timezone', time(), 'GMT')->getGMTDates(*string $format, int $interval, string|null $prefix);

Parameters

  • *string $format - The format of each date to display
  • int $interval - The frequency of rows
  • string|null $prefix - The prefix to add before each date display

Returns array, (*20)

Example

eden('timezone', time(), 'GMT')->getGMTDates('F d, Y');

====, (*21)

, (*22)

getOffset

Returns the current offset of this timezone, (*23)

Usage

eden('timezone', time(), 'GMT')->getOffset();

Parameters

Returns int, (*24)

====, (*25)

, (*26)

getOffsetDates

Returns a list of offsets and dates in a 24 hour period, (*27)

Usage

eden('timezone', time(), 'GMT')->getOffsetDates(*string $format, int $interval);

Parameters

  • *string $format - The format of each date to display
  • int $interval - The frequency of rows

Returns array, (*28)

Example

eden('timezone', time(), 'GMT')->getOffsetDates('F d, Y');

====, (*29)

, (*30)

getTime

Returns the time or date, (*31)

Usage

eden('timezone', time(), 'GMT')->getTime(string|null $format);

Parameters

  • string|null $format - Time format

Returns string|int, (*32)

Example

eden('timezone', time(), 'GMT')->getTime();

====, (*33)

, (*34)

getUTC

Returns the UTC Format, (*35)

Usage

eden('timezone', time(), 'GMT')->getUTC(string|null $prefix);

Parameters

  • string|null $prefix - The prefix to add before the returned value

Returns string, (*36)

Example

eden('timezone', time(), 'GMT')->getUTC();

====, (*37)

, (*38)

getUTCDates

Returns a list of UTC formats and dates in a 24 hour period, (*39)

Usage

eden('timezone', time(), 'GMT')->getUTCDates(*string $format, int $interval, string|null $prefix);

Parameters

  • *string $format - The format of each date to display
  • int $interval - The frequency of rows
  • string|null $prefix - The prefix to add before each date display

Returns array, (*40)

Example

eden('timezone', time(), 'GMT')->getUTCDates('F d, Y');

====, (*41)

, (*42)

toRelative

Returns the relative distance $time > this->time = ago, (*43)

Usage

eden('timezone', time(), 'GMT')->toRelative(int|string $time, int $level, string $default);

Parameters

  • int|string $time - The time to make relative
  • int $level - The granular level
  • string $default - The default date format

Returns Eden\Timezone\Index, (*44)

Example

eden('timezone', time(), 'GMT')->toRelative();

====, (*45)

, (*46)

setTime

Sets a new time, (*47)

Usage

eden('timezone', time(), 'GMT')->setTime(*int|string $time);

Parameters

  • *int|string $time - The time value

Returns Eden\Timezone\Index, (*48)

Example

eden('timezone', time(), 'GMT')->setTime(time() + 123);

====, (*49)

, (*50)

validation

Returns timezone's validation methods, (*51)

Usage

eden('timezone', time(), 'GMT')->validation();

Parameters

Returns Eden\Timezone\Index, (*52)

====, (*53)

, (*54)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*55)

Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. 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
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

The Versions

13/11 2015

dev-master

9999999-dev http://eden-php.com

Eden timezone component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/11 2015

4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

Eden timezone component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

Eden timezone component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

07/10 2015

v4

4.0.0.0 http://eden-php.com

Eden timezone component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.3

1.0.3.0 http://eden-php.com

Eden timezone component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.2

1.0.2.0 http://eden-php.com

Eden timezone component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden