2017 © Pedro Peláez
 

library offsettimezone

Create a DateTimeZone object by offset

image

kumatch/offsettimezone

Create a DateTimeZone object by offset

  • Tuesday, September 24, 2013
  • by kumatch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

OffsetTimezone

Create a DateTimeZone object by offset., (*1)

Install

Add "kumatch/offsettimezone" as a dependency in your project's composer.json file., (*2)

{
  "require": {
    "kumatch/offsettimezone": "*"
  }
}

And install your dependencies., (*3)

$ composer install

Usage

use Kumatch\OffsetTimeZone\OffsetTimeZone

$offsetTimeZone = new OffsetTimeZone();

$tz0 = $offsetTimeZone->createTimeZone(0);         // UTC timezone
$tz1 = $offsetTimeZone->createTimeZone( 9 * 3600); // UTC +9
$tz2 = $offsetTimeZone->createTimeZone(-7 * 3600); // UTC -7

// print UTC datetime.
$date = new DateTime("now", $tz0);
echo $date->format('Y-m-d H:i:s'), "\n";

// print UTC +9 datetime
$date->setTimetime($tz1);
echo $date->format('Y-m-d H:i:s'), "\n";

License

Licensed under the MIT License., (*4)

Copyright (c) 2013 Yosuke Kumakura, (*5)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*6)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*7)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*8)

The Versions

24/09 2013

dev-master

9999999-dev https://github.com/kumatch/php-offsettimezone

Create a DateTimeZone object by offset

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

date timezone

24/09 2013

0.1.0

0.1.0.0 https://github.com/kumatch/php-offsettimezone

Create a DateTimeZone object by offset

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

date timezone