')[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 + ' 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,'_');
}
";
if (isset($_GET['locale']) && isset($_GET['timezone']) && isset($_GET['calendar'])) {
if (1 == 6) {
$tz = reset(iterator_to_array(IntlTimeZone::createEnumeration(strtoupper(substr(urldecode($_GET['locale']),0,2)))));
$formatter = IntlDateFormatter::create(
urldecode($_GET['locale']),
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
$tz,
IntlDateFormatter::GREGORIAN
);
//ini_set('intl.default_locale', urldecode($_GET['locale']));
//ini_set('date.timezone', urldecode($_GET['timezone']));
//$cal = IntlCalendar::createInstance();
$cal = IntlCalendar::createInstance($tz, '@calendar=' . urldecode($_GET['calendar']));
$cal->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) . '
';
echo "Show Current Time
RJM Programming - December, 2024
As per (white background textboxes optional) ...
";
}
} 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()) . '
';
echo "Show Current Time
RJM Programming - December, 2024
As per (white background textboxes optional) ...
";
} 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) . '
';
echo "Show Current Time
RJM Programming - December, 2024
As per (white background textboxes optional) ...
";
} 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()) . '
';
echo "Show Current Time
RJM Programming - December, 2024
As per (white background textboxes optional) ...
";
} 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 "Show Current Time
RJM Programming - December, 2024
As per (white background textboxes optional) ...
";
}
echo "";
?>