PHP class used to convert date from "yymmdd" format to a human-readable string in a given language.
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
- 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