Skip to content

PHP class used to convert date from "yymmdd" format to a human-readable string in a given language.

Notifications You must be signed in to change notification settings

gerayzade/good-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

good-date

PHP class used to convert date from "yymmdd" format to a human-readable string in a given language.

How to use

include "/path/to/php/gooddate.php";
// including php class:

$baddate = "170102";
// 17 (yy), 01 (mm), 02 (dd) 

$gooddate = new GoodDate($baddate);
// instantiation

echo $gooddate->convertDate('en');
// printing date as a human-readable string in English language: 2 Jan. 2017

Supported languages

  • English (en)
  • Russian (ru)
  • Azerbaijani (az)
  • Germani (de)
  • French (fr)
  • Spanish (es)
  • Italian (it)

You can easily extend the class by declaring new array $month_[lang] with names of months in it.

private $month_en = array('Jan.', 'Feb.', 'Mar.', 'Apr.', ..., 'Nov.', 'Dec.');
// for ex. this array stands for months in English language

About

PHP class used to convert date from "yymmdd" format to a human-readable string in a given language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages