phpでどうするのかなぁと検索したら、みな自前でやってるっぽいですね。。。
Windowsではシステム(WINAPI)から取得できます
今(2019/01/12)時点で 2019/05/02を表示するとどうなってるのか確認メモ
//--------------------------------------------------------------------------- //! 元号チェック #include <vcl.h> #pragma hdrstop #include <tchar.h> #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- //! 日時書式化 /*! @param[in] stime @param[in] date_fmt @param[in] time_fmt @return 書式化された日時文字列 */ UnicodeString __fastcall GetDateTimeFormat( SYSTEMTIME *stime, const UnicodeString &date_fmt, const UnicodeString &time_fmt ) { TCHAR str[1024+1] = {0}; UnicodeString date_time_str; DWORD date_flags = ( date_fmt.Pos0(_T("gg")) >= 0 ) ? DATE_USE_ALT_CALENDAR : 0; if( ::GetDateFormat( LOCALE_USER_DEFAULT, date_flags, stime, date_fmt.c_str(), str, sizeof(str)/sizeof(str[0]) - 1 ) == 0 ) { RaiseLastOSError(); } date_time_str = str; if( ::GetTimeFormat( LOCALE_USER_DEFAULT, 0, stime, time_fmt.c_str(), str, sizeof(str)/sizeof(str[0]) - 1 ) == 0 ) { RaiseLastOSError(); } date_time_str += str; return date_time_str; } //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { Edit1->Text = _T("2019/05/02"); Button1->Click(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { const UnicodeString date_fmt1 = _T("ggyyyy年MM月dd日 ddd曜日"); const UnicodeString date_fmt2 = _T("yyyy年MM月dd日 ddd曜日"); const UnicodeString time_fmt = _T(""); SYSTEMTIME stime; ::ZeroMemory( &stime, sizeof(stime) ); stime.wYear = StrToInt(Edit1->Text.SubString0( 0, 4 )); stime.wMonth = StrToInt(Edit1->Text.SubString0( 5, 2 )); stime.wDay = StrToInt(Edit1->Text.SubString0( 8, 2 )); //::GetLocalTime( &stime ); Label1->Caption = ::GetDateTimeFormat( &stime, date_fmt1, time_fmt ); Label2->Caption = ::GetDateTimeFormat( &stime, date_fmt2, time_fmt ); } //---------------------------------------------------------------------------実行してみると。。。

まだ「平成」ですね。。。
5/2時限式に自動で変るか、5/2にWindowsUpdateでもあるんでしょうかね???
ちなみに、1899年だとこんな感じ
EXE置いておきます
test_gengo.7z