Generate a list of Moon Phase dates and times for any year with this free online tool. The format is CSV, so you can use it in PHP script, Javascript, or any other programming language or database. The data comes directly from the U.S. Naval Observatory Moon Phases Tool.
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:
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.