PHPackages                             sunnydrake/serverip-get-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sunnydrake/serverip-get-datetime

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sunnydrake/serverip-get-datetime
================================

Returns current DateTime for server ip. Uses API from http://worldtimeapi.org .

v1.0.3(4y ago)08GPL-3.0-or-laterPHP

Since Jun 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sunnydrake/serverip-get-datetme)[ Packagist](https://packagist.org/packages/sunnydrake/serverip-get-datetime)[ RSS](/packages/sunnydrake-serverip-get-datetime/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

SunnyDrake's Server IP Get DateTime PHP Lib with worldtimeapi.org API
=====================================================================

[](#sunnydrakes-server-ip-get-datetime-php-lib-with-worldtimeapiorg-api)

Requirements
------------

[](#requirements)

This module has no external dependencies. Needs allow\_url\_fopen set to true in php.ini or code.

Install via Composer
--------------------

[](#install-via-composer)

We recommend installing this package with [Composer](http://getcomposer.org/).

### Download Composer

[](#download-composer)

To download Composer, run in the root directory of your project:

```
curl -sS https://getcomposer.org/installer | php
```

You should now have the file `composer.phar` in your project directory.

### Install Dependencies

[](#install-dependencies)

Run in your project root:

```
php composer.phar require sunnydrake/serverip-get-datetime

```

You should now have the files `composer.json` and `composer.lock` as well as the directory `vendor` in your project directory. If you use a version control system, `composer.json` should be added to it.

### Require Autoloader

[](#require-autoloader)

After installing the dependencies, you need to require the Composer autoloader from your code:

```
require 'vendor/autoload.php';
```

Install without Composer
------------------------

[](#install-without-composer)

Place the 'ServerGetDateTime.php' file in the `include_path` as specified in your `php.ini` file or place it in the same directory as your PHP scripts.

Usage
-----

[](#usage)

Gets DateTime for current IP :

```
