Download the PHP package gazugafan/laravel-timezone without Composer

On this page you can find all versions of the php package gazugafan/laravel-timezone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-timezone

Laravel Timezone

Date/time timezone storage and retrieval for Laravel 5

A simple set of functions to assist in converting date/times between a global storage timezone, and a user's local timezone.

Requirements

Installation

Install via Composer...

Add the service provider to the array in ...

And add an alias to the array in ...

Overview

If your application is timezone-aware, you'll want to be converting all of your date/times to a single global timezone before storing them in the database. Then, when you retrieve these date/times, you'll want to convert them to the currently-logged-in user's local timezone before displaying them. This Timezone class contains a simple set of methods for doing just that!

Setup

First, you need to decide what global timezone you'll be using to store your date/times in. Most people recommend using UTC for this storage timezone, which is fair because it's commonly-used and somewhat expected. It really doesn't matter, though--so long as you pick one timezone and never change it. Personally, I recommend using whatever timezone you (or your DBA) is in. This way, when manually querying or browsing the database, you'll be seeing dates in your own timezone instead of UTC, which will probably be much easier to work with.

Got your storage timezone figured out? Good! Fill it into the entry in . It's the only place you'll need to specify it...

Next, you'll need to figure out how your user's timezone will be specified. A pretty straightforward way to do this would be adding a field to your user's table. By default, these helper methods will assume that's what you've done, and will retrieve the currently-logged-in user's timezone like this...

If you need help coming up with a list of timezones for your users to select from, here's a set of options you could use in a dropdown...

A whole bunch of options

If you've come up with some other way to get the currently-logged-in user's timezone, you can override this behavior by specifying your own callback function. Just to be safe, you'll probably want to return the app's default timezone (that you configured above), if no user is logged in...

Usage

There are two methods which you can use to convert date/times to and from the storage timezone. These are and . Both of them accept a date/time as the first parameter, which can be essentially any representation of a date, including DateTime, string, timestamp, another Carbon instance, etc. They'll also both return a Carbon instance of the converted date.

Use on a user--supplied date/time before storing it in the database. After retrieving a date/time from the database, use to convert it to the user's local timezone before displaying it. If you're doing an SPA, consider skipping entirely, and instead doing the conversion on the client-side using something like Moment.js.

Credits

Inspired by camroncade/timezone


All versions of laravel-timezone with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version >=4.2
nesbot/carbon Version ^1.22
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gazugafan/laravel-timezone contains the following files

Loading the files please wait ....