Moon Phases for PHP Script (CSV format)
Moon Phase Generator
The PHP script to get the moon phases downloads the date/times from the U.S. Naval Observatory Moon Phases Tool. It then parses out the date/times using a regular expression. It converts the date/times from UTC to the selected time zone. Then, it prints the data in multiple formats in a CSV format that can be opened in Excel.
The columns available are:
- date - in month/day/year format
- time - in hour:minute AM/PM format
- phase - the moon phase spelled out
- phaseid - an ID from 1 to 4 for the moon phase
- datetime - the date/time im MySQL format - YYYY-MM-DD HH:MM:SS
- timestamp - the unix time stamp
- friendlydate - date in format like "January 1, 2011"
Please do not link directly to this data. It is not designed to be high performance and will slow down your application. Download the data and store it in your system.
Disclaimer: This content is provided as-is. The information may be incorrect.