Skip to content

PHP library that translates time in Nigerian native dialects: Igala and English time translator.

Notifications You must be signed in to change notification settings

IgalaDigital/Igala-Time-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Igala Time PHP

A library that converts Time to its equivalent local languages of a basic Nigerian languages(Igala 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 Igala
require_once __DIR__.'/src/Igala.php';

// Import English Time Class
use LanguageTime\English;

//Import Igala Time Class
use LanguageTime\Igala;

Call Instance of the Class to Display Current Time

echo new Igala();
// Agogo Méjì Tule Mìnìtì Mélu
echo new English();
// Five Minutes after Two

Call time from timestamp

$igala = new Igala();
echo $igala->getTime(time());
echo $english->getTime(time());

Call time Igala from datestring

$igala = new Igala();
echo $igala->getTime("now");
echo $igala->getTime("today");
echo $igala->getTime("yesterday");
echo $igala->getTime("+ 7 days");
echo $igala->getTime("2019-12-20 12:50:00");
// Mìnìtì Mékwa koka ache

Call time English from datestring

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

echo $english->getTime("2019-12-20 12:50:00");
// Ten minutes to One

Call time from hours and minutes

$igala = new Igala();
$english = new Igala();
//12 hrs, 34 minutes
echo $igala->getTimeHour(12,34);
echo $english->getTimeHour(12,34);

Contribution

Contributions are very much welcome. Open issues or suggest edit if you find anything relating to word mistakes.

About

PHP library that translates time in Nigerian native dialects: Igala and English time translator.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages