PHP Classes

PHP Nigerian Time: Spell date and time values in Nigerian dialects

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 22 All time: 11,306 This week: 660Up
Version License PHP version Categories
nigerian_time_php 1.0The PHP License5PHP 5, Time and Date
Description 

Author

This package can be used to spell date and time values in Nigerian dialects.

It can take a timestamp integer value or a string that expresses a date and time value and and returns a string expressing the same date and time value in Nigerian dialects like Yoruba, Igbo, Hausa and also English.

The package can also take a time of the day expressed in terms of hours and minutes and returns a string that expresses that time in the same languages.

Picture of Erisan-fifth Olasheni
  Performance   Level  

 

Example

<?php
require __DIR__ . '/../vendor/autoload.php';

// Import Yoruba Time Class
use LanguageTime\English;

//Import Igbo Time Class
use LanguageTime\Hausa;

//Import Hausa Time Class
use LanguageTime\Igbo;

//Import English Time Class
use LanguageTime\Yoruba;

// Instantiate your classes

// For Yoruba
$yoruba = new Yoruba();
// For Igbo
$igbo = new Igbo();
// For Hausa
$hausa = new Hausa();
// For English
$english = new English();

//Call time from datestring
echo $yoruba->getTime("2017-10-09 12:34:00");

echo
$igbo->getTime("2017-10-09 12:34:00");

echo
$hausa->getTime("2017-10-09 12:34:00");

echo
$english->getTime("2017-10-09 12:34:00");


Details

Nigerian Time PHP

A library that converts Time to its equivalent local languages of 4 basic Nigerian languages(Yoruba, Hausa, Igbo and English)

Usage

To use this library, just require the needed Language class from the src folder:


//for English
require_once __DIR__.'/src/English.php';
//for Yoruba
require_once __DIR__.'/src/Yoruba.php';
//for Hausa
require_once __DIR__.'/src/Hausa.php';
//for Igbo
require_once __DIR__.'/src/Igbo.php';

// Import Yoruba Time Class
use LanguageTime\English;

//Import Hausa Time Class
use LanguageTime\Hausa;

//Import Igbo Time Class
use LanguageTime\Igbo;

//Import English Time Class
use LanguageTime\Yoruba;

Call Instance of the Class to Display Current Time

echo new Yoruba();
// Aago Ma?ru?n-u?n Ku i?sé?jú Méjì
echo new Hausa();
// Karfe Biyar Sauran Minti Biyu
echo new Igbo();
// Elekere  Ise O foro nkeji
echo new English();
// Two minutes to Five

Call time from timestamp

$yoruba = new Yoruba();
echo $yoruba->getTime(time());
echo $igbo->getTime(time());
echo $hausa->getTime(time());
echo $english->getTime(time());

Call time Yoruba from datestring

$yoruba = new Yoruba();
echo $yoruba->getTime("now");
echo $yoruba->getTime("today");
echo $yoruba->getTime("yesterday");
echo $yoruba->getTime("+ 7 days");
echo $yoruba->getTime("2017-10-09 12:50:00");
// Aago Kan Ku i?sé?jú M??wa?á

Call time Igbo from datestring

$igbo = new Yoruba();
echo $igbo->getTime("now");
echo $igbo->getTime("today");
echo $igbo->getTime("yesterday");
echo $igbo->getTime("+ 7 days");
echo $igbo->getTime("2017-10-09 12:50:00");
// Elekere  Otu O foro nkeji  Iri

Call time Hausa from datestring

$hausa = new Yoruba();
echo $hausa->getTime("now");
echo $hausa->getTime("today");
echo $hausa->getTime("yesterday");
echo $hausa->getTime("+ 7 days");
echo $hausa->getTime("2017-10-09 12:50:00");
// Karfe Daya Sauran Minti Goma

Call time English from datestring

$english = new Yoruba();
echo $english->getTime("now");
echo $english->getTime("today");
echo $english->getTime("yesterday");
echo $english->getTime("+ 7 days");

echo $english->getTime("2017-10-09 12:50:00");
// Ten minutes to One

Call time from hours and minutes

$yoruba = new Yoruba();
$igbo = new Yoruba();
$hausa = new Yoruba();
$english = new Yoruba();
//12 hrs, 34 minutes
echo $yoruba->getTimeHour(12,34);
echo $igbo->getTimeHour(12,34);
echo $hausa->getTimeHour(12,34);
echo $english->getTimeHour(12,34);

  Files folder image Files (13)  
File Role Description
Files folder imageexamples (3 files)
Files folder imagesrc (8 files)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:22
This week:0
All time:11,306
This week:660Up