'; $tabs=''; } else if (isset($_POST['timezone'])) { $tabp='
'; $tabs='
'; } $revealp=''; $reveals=''; $clockcss=''; $clocksvg="data:image/svg+xml;utf8,\\0023f0"; if (isset($_GET['clock']) || isset($_POST['clock'])) { $revealp='
' . $tabp; $reveals=$tabs . '
'; $clockcss="\n #pdfmt { border-radius: 50px; } \n"; } else { $revealp=$tabp; $reveals=$tabs; } $defloc=Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); $deficc=explode('_', str_replace('_posix','',$defloc))[-1 + sizeof(explode('_', str_replace('_posix','',$defloc)))]; $yourtzlist=""; $yls=explode(" data-geo='", $yourtzlist); //echo '' . sizeof($yls) . explode(' data-', $yourtzlist)[1]; //exit; for ($iy=(-1 + sizeof($yls)); $iy>=1; $iy--) { if (sizeof(explode(',', $yls[$iy])) > 3) { $icp=explode(',', $yls[$iy])[3]; //echo $icp; if ($icp == strtoupper($icp) && strlen($icp) == 2 && strpos($icp, '?') === false) { //echo $icp . ' data-geo="' . $yls[$iy] . ' becomes ' . ' title="' . orflag($icp) . '" data-geo="' . $yls[$iy]; //exit; $yourtzlist=str_replace(" data-geo='" . $yls[$iy], ' title=' . "'" . orflag($icp) . "'" . " data-geo='" . $yls[$iy], $yourtzlist); } } } if (strpos($yourtzlist, ',' . $deficc . ',') !== false) { $ourtz=explode('<', explode('>', explode(',' . $deficc . ',', $yourtzlist)[1])[1])[0]; } else { $ourtz="''"; //date.timezone; // ($_SERVER['TZ'] ?? (file_get_contents('/etc/timezone') ?: file_get_contents('/etc/localtime'))) } $lochelper="// If you modify this array, also update default language / dialect below ... thanks to Google https://www.google.com/intl/en/chrome/demos/speech.html var langs = [['Afrikaans', ['af-ZA']], ['አማርኛ', ['am-ET']], ['Azərbaycanca', ['az-AZ']], ['বাংলা', ['bn-BD', 'বাংলাদেশ'], ['bn-IN', 'ভারত']], ['Bahasa Indonesia',['id-ID']], ['Bahasa Melayu', ['ms-MY']], ['Català', ['ca-ES']], ['Čeština', ['cs-CZ']], ['Dansk', ['da-DK']], ['Deutsch', ['de-DE']], ['English', ['en-AU', 'Australia'], ['en-CA', 'Canada'], ['en-IN', 'India'], ['en-KE', 'Kenya'], ['en-TZ', 'Tanzania'], ['en-GH', 'Ghana'], ['en-NZ', 'New Zealand'], ['en-NG', 'Nigeria'], ['en-ZA', 'South Africa'], ['en-PH', 'Philippines'], ['en-GB', 'United Kingdom'], ['en-US', 'United States']], ['Español', ['es-AR', 'Argentina'], ['es-BO', 'Bolivia'], ['es-CL', 'Chile'], ['es-CO', 'Colombia'], ['es-CR', 'Costa Rica'], ['es-EC', 'Ecuador'], ['es-SV', 'El Salvador'], ['es-ES', 'España'], ['es-US', 'Estados Unidos'], ['es-GT', 'Guatemala'], ['es-HN', 'Honduras'], ['es-MX', 'México'], ['es-NI', 'Nicaragua'], ['es-PA', 'Panamá'], ['es-PY', 'Paraguay'], ['es-PE', 'Perú'], ['es-PR', 'Puerto Rico'], ['es-DO', 'República Dominicana'], ['es-UY', 'Uruguay'], ['es-VE', 'Venezuela']], ['Euskara', ['eu-ES']], ['Filipino', ['fil-PH']], ['Français', ['fr-FR']], ['Basa Jawa', ['jv-ID']], ['Galego', ['gl-ES']], ['ગુજરાતી', ['gu-IN']], ['Hrvatski', ['hr-HR']], ['IsiZulu', ['zu-ZA']], ['Íslenska', ['is-IS']], ['Italiano', ['it-IT', 'Italia'], ['it-CH', 'Svizzera']], ['ಕನ್ನಡ', ['kn-IN']], ['ភាសាខ្មែរ', ['km-KH']], ['Latviešu', ['lv-LV']], ['Lietuvių', ['lt-LT']], ['മലയാളം', ['ml-IN']], ['मराठी', ['mr-IN']], ['Magyar', ['hu-HU']], ['ລາວ', ['lo-LA']], ['Nederlands', ['nl-NL']], ['नेपाली भाषा', ['ne-NP']], ['Norsk bokmål', ['nb-NO']], ['Polski', ['pl-PL']], ['Português', ['pt-BR', 'Brasil'], ['pt-PT', 'Portugal']], ['Română', ['ro-RO']], ['සිංහල', ['si-LK']], ['Slovenščina', ['sl-SI']], ['Basa Sunda', ['su-ID']], ['Slovenčina', ['sk-SK']], ['Suomi', ['fi-FI']], ['Svenska', ['sv-SE']], ['Kiswahili', ['sw-TZ', 'Tanzania'], ['sw-KE', 'Kenya']], ['ქართული', ['ka-GE']], ['Հայերեն', ['hy-AM']], ['தமிழ்', ['ta-IN', 'இந்தியா'], ['ta-SG', 'சிங்கப்பூர்'], ['ta-LK', 'இலங்கை'], ['ta-MY', 'மலேசியா']], ['తెలుగు', ['te-IN']], ['Tiếng Việt', ['vi-VN']], ['Türkçe', ['tr-TR']], ['اُردُو', ['ur-PK', 'پاکستان'], ['ur-IN', 'بھارت']], ['Ελληνικά', ['el-GR']], ['български', ['bg-BG']], ['Pусский', ['ru-RU']], ['Српски', ['sr-RS']], ['Українська', ['uk-UA']], ['한국어', ['ko-KR']], ['中文', ['cmn-Hans-CN', '普通话 (中国大陆)'], ['cmn-Hans-HK', '普通话 (香港)'], ['cmn-Hant-TW', '中文 (台灣)'], ['yue-Hant-HK', '粵語 (香港)']], ['日本語', ['ja-JP']], ['हिन्दी', ['hi-IN']], ['ภาษาไทย', ['th-TH']]]; "; $lochelpertwo=file_get_contents('http://en.wikipedia.org/wiki/List_of_ISO_639_language_codes'); $calsel=''; if (1 == 1) { $bundle=new ResourceBundle('','ICUDATA'); $cnames=[]; $calendars=$bundle->get('calendar'); foreach ($calendars as $n=>$v) { if ($calsel == '') { $calsel=""; } $calsel=str_replace("", "", $calsel); $cnames[]=$n; } } $locsel=''; $arrl=ResourceBundle::getLocales(''); for ($df=0; $df 1) { $endih.=' ' . explode("'", explode("['", $ends[0])[-1 + sizeof(explode("['", $ends[0]))])[0]; } if (strpos($lochelpertwo, '>' . explode('-',explode('_',$arrl[$df])[0])[0] . '') !== false) { //echo "yes " . explode('-',explode('_',$arrl[$df])[0])[0] . "\n
"; //echo substr(explode('>' . explode('-',explode('_',$arrl[$df])[0])[0] . '', $lochelpertwo)[0], -250,250); $interim=explode('', explode('' . explode('-',explode('_',$arrl[$df])[0])[0] . '', $lochelpertwo)[0])[-1 + sizeof(explode('' . explode('-',explode('_',$arrl[$df])[0])[0] . '', $lochelpertwo)[0]))])[0]; //)[-1 + sizeof(explode('>', explode('', explode('' . explode('-',explode('_',$arrl[$df])[0])[0] . '', $lochelpertwo)[0]; //exit; $aintm=explode('>', $interim)[-1 + sizeof(explode('>', $interim))]; if (strpos($endih, ' ' . $aintm) === false) { if ($endih != '') { $endih.=' (' . $aintm . ')'; } else { $endih.=' ' . $aintm; } } } if ($lastword == strtoupper($lastword) && strlen($lastword) == 2) { $endih.=' ' . orflag($lastword); } if ($endih != '') { $endih="\t" . $endih . ''; } if (strpos(($arrl[$df] . '_'), '_') !== false) { //} && strpos($arrl[$df], '0') === false) { if ($locsel == '') { $locsel=""; } $locsel=str_replace("", "", $locsel); } } $ctynames=" "; echo "PHP Intl Current Time via Locale and TimeZone and optional Calendar - RJM Programming - December, 2024 var ctynames=\"" . str_replace("\n","",$ctynames) . "\"; var canmakenothing=false, firstloc=''; var documentURL=document.URL; var repcnt=0, cnb='', isov='', txils=[]; //if (documentURL.indexOf('clock=') != -1) { setTimeout(function(){ document.getElementById('justincase').src=documentURL=documentURL.replace('clock=','cloNOWAYck=') + '&rand=' + repcnt; ), 1000); } var thistz=(location.search.split('timezone=')[1] ? (decodeURIComponent(location.search.split('timezone=')[1].split('&')[0]) + '') : ''); function onlit() { txils=parent.document.getElementById('tzsel').innerHTML.split(' value=\"' + thistz + '\"'); if (eval('' + txils.length) > 1) { isov=txils[1].split('>')[0].split(',')[3]; cnb=''; if (ctynames.indexOf(\" value='\" + isov + \"'>\") != -1) { cnb=' in ' + ctynames.split(\" value='\" + isov + \"'>\")[1].split('<')[0]; document.getElementById('tzsel').title='Default is a Timezone in ' + ctynames.split(\" value='\" + isov + \"'>\")[1].split('<')[0]; document.getElementById('myh1').innerHTML+=' for ' + (thistz + '/').replace(thistz.split('/')[0] + '/', '').split('/')[1].replace(/\_/g,' ') + ' ' + (thistz + '/').replace(thistz.split('/')[0] + '/', '').split('/')[0].replace(/\_/g,' ').trim().replace('Argentina',''); document.getElementById('myh1').innerHTML+=cnb + ' ' + jorflag(isov); } } } function clockif(iois) { if (iois.src.indexOf('About_Us.') == -1) { repcnt++; setTimeout(function(){ iois.src=iois.src.split('&rand=')[0] + '&rand=' + repcnt; }, 1000); var aconto = (iois.contentWindow || iois.contentDocument); if (aconto != null) { if (aconto.document) { aconto = aconto.document; } if (aconto.body != null) { if (aconto.getElementById('pdfmt') && parent.document.getElementById('pdfmt')) { parent.document.getElementById('pdfmt').innerHTML=aconto.getElementById('pdfmt').innerHTML; if (repcnt == 1) { parent.document.getElementById('pdfmt').style.border='5px dotted pink'; parent.document.getElementById('pdfmt').style.padding='5 5 5 5'; if (eval('' + txils.length) > 1) { parent.document.getElementById('pdfmt').title='Timestamp for ' + documentURL.split('?')[1].split('&cl')[0].replace(/\&/g,' ').replace(/\=/g,' ').replace(/\%2F/g,'/').replace(/\%2f/g,'/') + txils[1].split('>')[0] + cnb; } else { parent.document.getElementById('pdfmt').title='Timestamp for ' + documentURL.split('?')[1].split('&cl')[0].replace(/\&/g,' ').replace(/\=/g,' ').replace(/\%2F/g,'/').replace(/\%2f/g,'/'); } } } } } } } function tzdef(inloc) { var inicc=inloc.replace(/\-/g,'_').split('_')[eval(-1 + inloc.replace(/\-/g,'_').split('_').length)]; var jnicc=inicc; var newtstuff='', newlstuff='', newts=0, newls=0, tvalis=''; if (ctynames.indexOf(\" value='\" + inicc + \"'>\") != -1) { jnicc=ctynames.split(\" value='\" + inicc + \"'>\")[1].split('<')[0]; } if (document.getElementById('timezone').value == '' && inicc.trim() != '' && inicc == inicc.toUpperCase() && eval('' + inicc.length) == 2) { var tzoh=document.getElementById('tzsel').innerHTML; var aftertopt=document.getElementById('toptone').outerHTML; var tzloh=document.getElementById('locsel').innerHTML; var afterlopt=document.getElementById('loptone').outerHTML; var tzs=tzoh.split(',' + inicc + ','); if (eval('' + tzs.length) > 1) { //document.getElementById('timezone').value=tzs[1].split('>')[1].split('<')[0]; tvalis=tzs[1].split('>')[1].split('<')[0]; newtstuff+=''; for (newts=1; newts')[1].split('<')[0] != tvalis) { newtstuff+=''; } } tzs=tzloh.split('_' + inicc + '\"'); if (eval('' + tzs.length) > 1) { newlstuff+=''; for (newls=1; newls')[1].split('<')[0] != inloc) { newlstuff+=''; } } } } if (tzoh.indexOf(aftertopt) != -1 && newtstuff != '') { document.getElementById('tzsel').innerHTML=aftertopt.replace(' id=', ' data-id=').replace(' value=\"', ' value=\" ').replace(' a Time', ' ' + jnicc + ' ' + jorflag(inicc) + ' Time') + newtstuff + aftertopt + tzoh.split(aftertopt)[1]; } if (tzloh.indexOf(afterlopt) != -1 && newlstuff != '') { document.getElementById('locsel').innerHTML=afterlopt.replace(' id=', ' data-id=').replace(' value=\"', ' value=\" ').replace(' a Locale', ' ' + jnicc + ' Locale') + newlstuff + afterlopt + tzloh.split(afterlopt)[1]; } if (tvalis != '') { document.getElementById('timezone').value=tvalis; } document.getElementById('locsel').value=inloc; firstloc=inicc; canmakenothing=true; } if (document.getElementById('tzsel').value == ' ' && canmakenothing) { if (inicc != firstloc) { document.getElementById('tzsel').value=''; } } return inloc.replace(/\-/g,'_'); } function jorflag(thiscc) { var lri='ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var dri=['127462','127463','127464','127465','127466','127467','127468','127469','127470','127471','127472','127473','127474','127475','127476','127477','127478','127479','127480','127481','127482','127483','127484','127485','127486','127487']; var ccsuff='', ccchar=' ', cde=''; for (var iccsuff=0; iccsuff set(IntlCalendar::FIELD_MONTH, 0); // 1st month, 1st day ... 9th month, Ramadan $cal->set(IntlCalendar::FIELD_DAY_OF_MONTH, 1); //1st day $cal->clear(IntlCalendar::FIELD_HOUR_OF_DAY); $cal->clear(IntlCalendar::FIELD_MINUTE); $cal->clear(IntlCalendar::FIELD_SECOND); $cal->clear(IntlCalendar::FIELD_MILLISECOND); echo "In this " . explode('-', urldecode($_GET['calendar']))[0] . " year, the first day of the year started/will start on:\n\t", $formatter->format($cal), "\n"; //Itʼs the formatterʼs timezone that is used: $formatter->setTimeZone(urldecode($_GET['timezone'])); echo "After changing timezone:\n\t", $formatter->format($cal), "\n"; } else { $DateTime = new DateTime(); $IntlDateFormatter = new IntlDateFormatter( urldecode($_GET['locale']) . '@calendar=' . urldecode($_GET['calendar']), IntlDateFormatter::FULL, IntlDateFormatter::FULL, urldecode($_GET['timezone']), IntlDateFormatter::TRADITIONAL); echo '

' . $IntlDateFormatter->format($DateTime) . '


' . $revealp . '
'; echo "

Show Current Time


RJM Programming - December, 2024


As per (white background textboxes optional) ...




 " . $locsel . "
 " . $yourtzlist . "
 " . $calsel . "

 
" . $reveals . " "; } } else if (isset($_GET['locale']) && isset($_GET['timezone']) && !isset($_GET['calendar'])) { $fmt = datefmt_create( urldecode($_GET['locale']), IntlDateFormatter::FULL, IntlDateFormatter::FULL, urldecode($_GET['timezone']), IntlDateFormatter::GREGORIAN ); echo '

' . datefmt_format($fmt, time()) . '


' . $revealp . '
'; echo "

Show Current Time


RJM Programming - December, 2024


As per (white background textboxes optional) ...




 " . $locsel . "
 " . $yourtzlist . "
 " . $calsel . "

 
" . $reveals . " "; } else if (isset($_POST['locale']) && isset($_POST['timezone']) && isset($_POST['calendar'])) { $DateTime = new DateTime(); $IntlDateFormatter = new IntlDateFormatter( urldecode($_POST['locale']) . '@calendar=' . urldecode($_POST['calendar']), IntlDateFormatter::FULL, IntlDateFormatter::FULL, urldecode($_POST['timezone']), IntlDateFormatter::TRADITIONAL); echo '

' . $IntlDateFormatter->format($DateTime) . '


' . $revealp . '
'; echo "

Show Current Time


RJM Programming - December, 2024


As per (white background textboxes optional) ...




 " . $locsel . "
 " . $yourtzlist . "
 " . $calsel . "

 
" . $reveals . " "; } else if (isset($_POST['locale']) && isset($_POST['timezone']) && !isset($_POST['calendar'])) { $fmt = datefmt_create( urldecode($_POST['locale']), IntlDateFormatter::FULL, IntlDateFormatter::FULL, urldecode($_POST['timezone']), IntlDateFormatter::GREGORIAN ); echo '

' . datefmt_format($fmt, time()) . '


' . $revealp . '
'; echo "

Show Current Time


RJM Programming - December, 2024


As per (white background textboxes optional) ...




 " . $locsel . "
 " . $yourtzlist . "
 " . $calsel . "

 
" . $reveals . " "; } else if (isset($_GET['test'])) { $fmt = datefmt_create( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo '

First Formatted output is ' . datefmt_format($fmt, 0) . '


'; $fmt = datefmt_create( 'de-DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN ); echo '

Second Formatted output is ' . datefmt_format($fmt, 0) . '


'; $fmt = datefmt_create( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, 'MM/dd/yyyy' ); echo '

First Formatted output with pattern is ' . datefmt_format($fmt, 0) . '


'; $fmt = datefmt_create( 'de-DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, 'MM/dd/yyyy' ); echo "

Second Formatted output with pattern is " . datefmt_format($fmt, 0) . '


'; } else { echo $revealp . "

Show Current Time


RJM Programming - December, 2024


As per (white background textboxes optional) ...




 " . $locsel . "
 " . $yourtzlist . "
 " . $calsel . "

 
" . $reveals . " "; } echo ""; ?>