From the VWS Moon Day tag, you can use something like this WD specific function to decode what the phase should be based on the age and percent illumination .. adjust it to fit the VWS variable output for moon day/percent
//=========================================================================
// decode WD %moonage% tag and return a text description for the moon phase name
// "Moon age: 10 days,10 hours,41 minutes,80%"
function moonphase ($WDmoonage) {
preg_match_all('|(\d+)|is',$WDmoonage,$matches);
// print "<!-- matches=\n" . print_r($matches,true) . "-->\n";
$mdays = $matches[1][0];
$mhours = $matches[1][1];
$mmins = $matches[1][2];
$mpct = $matches[1][3];
$mdaysd = $mdays + ($mhours / 24) + ($mmins / 1440);
// Definitions from http://www.answers.com/topic/lunar-phase
// * Dark Moon - Not visible
// * New Moon - Not visible, or traditionally, the first visible crescent of the Moon
// * Waxing Crescent Moon - Right 1-49% visible
// * First Quarter Moon - Right 50% visible
// * Waxing gibbous Moon - Right 51-99% visible
// * Full Moon - Fully visible
// * Waning gibbous Moon - Left 51-99% visible
// * Third Quarter Moon - Left 50% visible
// * Waning Crescent Moon - Left 1-49% visible
// * New Moon - Not visible
if ($mdaysd <= 29.53/2) { // increasing illumination
$ph = "Waxing";
$qtr = "First";
} else { // decreasing illumination
$ph = "Waning";
$qtr = "Last";
}
if ($mpct < 1 ) { return("New Moon"); }
if ($mpct <= 49) { return("$ph Crescent"); }
if ($mpct < 51) { return("$qtr Quarter"); }
if ($mpct < 99) { return("$ph Gibbous"); }
return("Full Moon");
}
Best regards,
Ken