PHPackages                             rawphp/raw-datetime - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rawphp/raw-datetime

ActiveLibrary

rawphp/raw-datetime
===================

RawDateTime is a wrapper with useful utility functions around the DateTime class and is used by RawPHP framework and other applications.

0387PHP

Since Dec 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/rawphp/RawDateTime)[ Packagist](https://packagist.org/packages/rawphp/raw-datetime)[ RSS](/packages/rawphp-raw-datetime/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

RawDateTime - An DateTime Class Extension
=========================================

[](#rawdatetime---an-datetime-class-extension)

[![Build Status](https://camo.githubusercontent.com/6c19dc4572be14af26e1ae9aa2c7b3000c56457127b789e61405cae340fb5a14/68747470733a2f2f7472617669732d63692e6f72672f7261777068702f5261774461746554696d652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rawphp/RawDateTime)

Package Features
----------------

[](#package-features)

- User to UTC time conversion
- UTC to User time conversion
- Get span between two dates in years, months, weeks, days, hours, minutes and seconds

Installation
------------

[](#installation)

### Composer

[](#composer)

RawDateTime is available via [Composer/Packagist](https://packagist.org/packages/rawphp/raw-datetime).

Add `"rawphp/raw-datetime": "0.*@dev"` to the require block in your composer.json and then run `composer install`.

```
{
        "require": {
            "rawphp/raw-datetime": "0.*@dev"
        }
}
```

You can also simply run the following from the command line:

```
composer require rawphp/raw-datetime "0.*@dev"
```

### Tarball

[](#tarball)

Alternatively, just copy the contents of the RawDateTime folder into somewhere that's in your PHP `include_path` setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.

Basic Usage
-----------

[](#basic-usage)

```
