2017 © Pedro Peláez
 

library timezones

Carbon wrapper for easy timezone functionality in Laravel.

image

raphaelb/timezones

Carbon wrapper for easy timezone functionality in Laravel.

  • Sunday, July 9, 2017
  • by Raphaelb
  • Repository
  • 1 Watchers
  • 1 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 1 % Grown

The README.md

Laravel logo Laravel Timezones

Build status GitHub Version Total Downloads License, (*1)

Laravel package providing easy Timezone functionality., (*2)

Made for people who really just want to have an easy way of going about dealing with timezones., (*3)

Composer require
"raphaelb/timezones": "~1.4"
Laravel
Raphaelb\Timezones\TimezonesServiceProvider::class,
'Timezones'  => Raphaelb\Timezones\Facades\Timezones::class

use Raphaelb\Timezones\Facades\Timezones;
Examples
class User {

    // Accessors in model class.

    /**
     * Get created_at attr.
     * @param $date
     * @return string
     */
    public function getCreatedAtAttribute($date)
    {
        return app('timezones')
            ->toTimezone($date, 'gmt')
            ->format('d-m-Y H:i:s');
    }

    /**
     * Get updated_at attr.
     * 
     * @param $date
     * @return string
     */
    public function getUpdatedAtAttribute($date)
    {
        return app('timezones')
                ->toTimezone($date, 'gmt')
                ->format('d-m-Y H:i:s');
    }

    /**
     * Or inject a format when you know the given one. 
     * Otherwise Carbon will fail. 
     */
    public function time()
    {
        // Constructor accepts a different format for your needs.
        $time = new Timezones('m-d-Y H:i:s');
        return $time->toTimezone('09-03-2016 16:00:00', 'EST');
    }

}

License

MIT Licensed, (*4)

The Versions

09/07 2017

dev-master

9999999-dev https://raphaelbronsveld.com/timezones

Carbon wrapper for easy timezone functionality in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel carbon time timezones

09/07 2017

v1.4.1

1.4.1.0 https://raphaelbronsveld.com/timezones

Carbon wrapper for easy timezone functionality in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel carbon time timezones

09/07 2017

dev-develop

dev-develop https://raphaelbronsveld.com/timezones

Carbon wrapper for easy timezone functionality in Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework carbon time timezones

29/05 2017

v1.4.0

1.4.0.0 https://raphaelbronsveld.com/timezones

Carbon wrapper for easy timezone functionality in Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

laravel carbon time timezones

22/03 2017

v1.3.3

1.3.3.0 https://github.com/Raphaelbronsveld/timezones

Easy timezone usability using the Carbon class in Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel time timezones

22/03 2017

v1.3.0

1.3.0.0 https://github.com/Raphaelbronsveld/timezones

Easy timezone usability using the Carbon class in Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel time timezones

06/04 2016

v1.3.2

1.3.2.0 https://github.com/Raphaelbronsveld/timezones

Easy timezone usability using the Carbon class in Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel time timezones

05/04 2016

v1.3.1

1.3.1.0 https://github.com/Raphaelbronsveld/timezones

Easy timezone usability using the Carbon class in Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel time timezones

13/01 2016

v1.2.0

1.2.0.0 https://github.com/Raphaelbronsveld/timezones

Easy timezone usability using the Carbon class.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel time timezones

13/01 2016

v1.1.0

1.1.0.0

Checking your timezone!

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

12/01 2016

v1.0.0

1.0.0.0

Checking your timezone!

  Sources   Download

MIT

The Requires

  • php >=5.4.0