";
foreach ($sun_info as $key => $val) {
$results.=" $key: " . date("H:i:s", $val) . " " . $tzis . "
";
}
$results.="
";
}
$yyyy=explode("-", $dateis)[0];
$mnthis=(-1 + explode("-", $dateis)[1]);
$dythis=explode("-", $dateis)[2];
} else if (isset($_POST['dmdates'])) {
$dateis=urldecode($_POST['dmdates']);
if (isset($_POST['latitude']) && isset($_POST['longitude'])) {
$latis=urldecode($_POST['latitude']);
$longis=urldecode($_POST['longitude']);
$sun_info = date_sun_info(strtotime($dateis), $latis, $longis);
$results.="
";
foreach ($sun_info as $key => $val) {
$results.=" $key: " . date("H:i:s", $val) . " " . $tzis . "
";
}
$results.="
";
}
$yyyy=explode("-", $dateis)[0];
$mnthis=(-1 + explode("-", $dateis)[1]);
$dythis=explode("-", $dateis)[2];
}
echo "
Sun Information - RJM Programming - January, 2018 ... Thanks to http://php.net/manual/en/function.date-sun-info.php
var today=new Date();
var yyyy = today.getFullYear();
var mnthis = today.getMonth();
var dythis = today.getDate();
var selc = 0;
var geolocation = null;
function errorHandler(err) {
if (err.code == 1) {
if (1 == 2) alert('Access is denied');
}
}
function showLocation( position ) {
document.getElementById('latitude').value = '' + position.coords.latitude;
document.getElementById('longitude').value = '' + position.coords.longitude;
}
function getLocation() {
if (selc == 0) {
selc=1;
geolocation = navigator.geolocation;
geolocation.getCurrentPosition(showLocation, errorHandler, {maximumAge: 75000});
}
}
function ol() {
var tzis='' + Intl.DateTimeFormat().resolvedOptions().timeZone; /" . "/ Thanks to https://stackoverflow.com/questions/22618056/javascript-timezone-information-how-to-get-america-los-angeles-or-equivalent/22625076#22625076
if (tzis != '') document.getElementById('timezone').value=tzis;
document.getElementById('myform').action=document.URL.split('#')[0].split('?')[0];
var dprefix='0', mprefix='0', i, months=['','January','February','March','April','May','June','July','August','September','October','November','December'];
for (i=eval('' + yyyy) + 1; i>(eval('' + yyyy) - 100); i--) {
if (i == " . $yyyy . ") {
document.getElementById('dmdates').value='' + i;
document.getElementById('syears').innerHTML+='';
} else {
document.getElementById('syears').innerHTML+='';
}
}
for (i=1; i<=12; i++) {
if (eval(-1 + i) == " . $mnthis . ") {
document.getElementById('dmdates').value+='-' + mprefix + i;
document.getElementById('smonths').innerHTML+='';
} else {
document.getElementById('smonths').innerHTML+='';
}
if (i == 9) mprefix='';
}
for (i=1; i<=31; i++) {
if (i == " . $dythis . ") {
document.getElementById('dmdates').value+='-' + mprefix + i;
document.getElementById('sdays').innerHTML+='';
} else {
document.getElementById('sdays').innerHTML+='';
}
if (i == 9) dprefix='';
}
getLocation();
}
function dc(sois) {
if (sois.value != '') {
var paro=null, lastc=sois.id.slice(-1);
if (sois.id.indexOf('year') != -1) {
paro=document.getElementById(sois.id.replace('s','dm').replace('year','date'));
if (paro.value == '') {
if (document.getElementById(sois.id.replace('year' + lastc,'month' + lastc)).value == '') {
document.getElementById(sois.id.replace('year' + lastc,'month' + lastc)).value='01';
}
if (document.getElementById(sois.id.replace('year' + lastc,'day' + lastc)).value == '') {
document.getElementById(sois.id.replace('year' + lastc,'day' + lastc)).value='01';
}
}
paro.value=sois.value + '-' + document.getElementById(sois.id.replace('year' + lastc,'month' + lastc)).value + '-' + document.getElementById(sois.id.replace('year' + lastc,'day' + lastc)).value;
} else if (sois.id.indexOf('month') != -1) {
paro=document.getElementById(sois.id.replace('s','dm').replace('month','date'));
if (paro.value == '') {
if (document.getElementById(sois.id.replace('month' + lastc,'day' + lastc)).value == '') {
document.getElementById(sois.id.replace('month' + lastc,'day' + lastc)).value='01';
}
if (document.getElementById(sois.id.replace('month' + lastc,'year' + lastc)).value == '') {
document.getElementById(sois.id.replace('month' + lastc,'year' + lastc)).value='' + yyyy;
}
}
paro.value=document.getElementById(sois.id.replace('month' + lastc,'year' + lastc)).value + '-' + sois.value + '-' + document.getElementById(sois.id.replace('month' + lastc,'day' + lastc)).value;
} else if (sois.id.indexOf('day') != -1) {
paro=document.getElementById(sois.id.replace('s','dm').replace('day','date'));
if (paro.value == '') {
if (document.getElementById(sois.id.replace('day' + lastc,'month' + lastc)).value == '') {
document.getElementById(sois.id.replace('day' + lastc,'month' + lastc)).value='01';
}
if (document.getElementById(sois.id.replace('day' + lastc,'year' + lastc)).value == '') {
document.getElementById(sois.id.replace('day' + lastc,'year' + lastc)).value='' + yyyy;
}
}
paro.value=document.getElementById(sois.id.replace('day' + lastc,'year' + lastc)).value + '-' + document.getElementById(sois.id.replace('day' + lastc,'month' + lastc)).value + '-' + sois.value;
}
}
}
function checkthings() {
return true;
}
window.onload=ol;
Sun Information
RJM Programming - January, 2018
" . $results . "