Skip Site Navigation «

dbrowse

app«dbrowse
MySQL

Selected Data

This node is informative, descriptive, functional and terminating.
[definitions]

Query Path

Interactive Path

Description of Results

While perhaps not as old as the moon itself, the history behind the data in the MySQL moon_phases table stretches (to my knowledge at least) as far back as 1987. It began life as the C program moontool. Along the way, various folks have ported it to Java, VB and, in 1998, to Perl by Raino Pikkarainen. These days you can find the Perl version on CPAN as Astro::MoonPhase, which is now maintained by Brett Hamilton of simple.be.

The idea behind this table is to avoid some heavy-duty floating point calculations at run-time. As you can see from the results, they come back pretty quickly. So, for any requested month in the calendar, I use this table to determine which days any of these moon phases falls on:

A little later on this year I plan on publishing an article on the last, rare, and misunderstood Blue Moon. Hint: check your calendars for August 2005. Folks that are interested in using this data for their own applications will find the following resources helpful:

  1. mysql> create table moon_phases syntax.
  2. popmoon.pl (Perl script to populate the table).
  3. upblue.pl (Perl script to update full moons that are blue).
  4. mysql.pl (sample DBI/DBD/MySQL connection parameters script).
  5. moon_phases.sql.gz (gzip compressed table schema/data dump).
  6. gzip: FreeBSD man page.
  7. gzip: Home page.

See also: the seasons table and data.

Node/View

Table dcal.moon_phases: Selected data.
mysql> select *
mysql> from dcal.moon_phases
mysql> where year(date)=2008 and month(date)=08;
date phase
5 rows in set (0.0041 seconds)
2008-08-01 New Moon
2008-08-08 First Quarter Moon
2008-08-16 Full Moon
2008-08-23 Last Quarter Moon
2008-08-30 New Moon

Last updated: Tuesday, February 28th, 2006 @ 2:38 AM EST [2006-02-28T07:38:14Z]   home

(c) 2006-2008, Douglas W. Clifton, loadaveragezero.com, all rights reserved.