It looks like I have a problem with time/date in some areas of the dasboard and have not been able to figure out where the problem is.
Scott,
I'm seeing the same issues with date formats.
http://www.lakemaryweather.com/wdl/wxindex6.php (work in progress)
I perfer them to be MM/DD/YYYY
(Wind Chill, Almanac, and Station All Time Records)
Like I mentioned in the previous note about that, the problem is in the conversion of dates and the java script. I have not been able to figure out the problem. I'm not a java person and there are so many formats for the dates. Perhaps Ken would be willing to look at the code and see if he can see why only certain dates will not convert correctly.
Scott
Scott,
1> I was asking about "Wind Chill", "Almanac", and "Station All Time Records". You have "Wind Chill" and "Station All Time Records" on your Webster Weather home page as "Jan-15-2009". My issue was they displayed as "13-Nov-2009" and I wanted them to display like yours, or better yet as "11/13/2009". This is definitely different with what you said in an early note about date conversions and java script.
I have fixed this on my own by changing my setting.php variable:
$SITE['dateOnlyFormat'] = 'm/d/Y';
2> I do agree "Almanac" data is a definitely a JS issue. I see in my testtags.php file:
$nextnewmoon = '02:31 UTC 3 February 2011'; // Date/time of the next new moon for next month
$fullmoon = '21:22 UTC 19 January 2011'; // Date/time of the next/last full moon
$fullmoondate = ' 19 January 2011'; // Date of the next/last full moon (date only)
etc.
I also saw in my WD "Control Panel > Solar/Lunar & Coordinates" my "SUN/MOON Set and Rise Times" had:
First Quarter 12 January 2011
Full moon 19 January 2011
Last Quarter26 January 2011
New moon 3 February 2011
Moon age: 3 days,13 hours,34 minutes,17%
Hours of possible daylight today was 10:25
I noticed the date/time on my wxastronomy.php page was formatted exactly like I wanted it. Digging into the code on that PHP page I borrowed Kevin's or Ken's "$indate" java script function:
function get_localdate ( $indate) {
global $SITE;
$EnglishMonths = array(
'January','February','March','April','May','June',
'July','August','September','October','November','December');
// Change '02:33 UTC 4 September 2007' to
// specified date by
$timeFormat = 'D, d-M-Y h:ia T'; // Fri, 31-Mar-2006 14:03 TZone
// $timeFormat = 'h:ia T D, d-M-Y '; // Fri, 31-Mar-2006 14:03 TZone
if(isset($SITE['timeFormat'])) { $timeFormat = $SITE['timeFormat']; }
$utcstr = substr($indate,10) . " " . substr($indate,0,9); // move formats
if (isset($SITE['monthNames'])) {
// convert TO English for strtotime()
echo "<!-- before utcstr='$utcstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
$utcstr = preg_replace('|'.$SITE['monthNames'][$i].'|i',$monthEN,$utcstr);
}
echo "<!-- after utcstr='$utcstr' -->\n";
}
$utc = strtotime($utcstr);
$lclstr = date($timeFormat,$utc);
if (isset($SITE['monthNames'])) {
// convert From English for return (will only work if long-format month names in $timeFormat)
echo "<!-- before lclstr='$lclstr' -->\n";
foreach ($EnglishMonths as $i => $monthEN) {
$lclstr = preg_replace('|'.$monthEN.'|i',$SITE['monthNames'][$i],$lclstr);
}
echo "<!-- after lclstr='$lclstr' -->\n";
}
return ($lclstr);
}
By adding it to the end of my ajax-dashboard6.php file, and updating your two lines in "Almanac" section with:
From:
<?php echo $fullmoondate; ?>
To:
<?php echo get_localdate($fullmoondate); ?>
From:
<?php echo $nextnewmoon; ?>
To:
<?php echo get_localdate($nextnewmoon); ?>
Plus modifiying setting.php
$SITE['timeFormat'] = 'm/d/Y g:ia';
it's now perfect (for my tastes). "Full Moon:" now shows "01/20/2011 3:11am" and New Moon:" shows "02/02/2011 9:31pm".
http://www.lakemaryweather.com/wdl/wxindex6.phpHope this helps you and others with this issue.
Next to fix:
"UV Summary/Forecast" date format
"Moon" at 1% and it should read 20%, as my current Webster Alternative-Dashboard Version 4.20 does.