Astro version 2.1.0
This is the changelog for Astro version 2.1.0 released on April 7th, 2026. For older changelogs please consult the release tag on GitHub
Bug Fixes
Fix application startup when neither
:tznor:tzdatais configured.Astro.default_options/0now falls back totime_zone_database: nilinstead of raisingCondClauseError. Calls that do not require a time zone database (e.g.time_zone: :utc) now work without any time zone library installed.Fix
Astro.Supervisor.start_link/2to gracefully handle the case where:tz_worldis not installed. Previously the supervisor unconditionally referencedTzWorld.Backend.DetsWithIndexCacheand crashed at startup when the optional dependency was missing.
Enhancements
Add
Astro.new_visible_crescent/3to predict the visibility of the new crescent moon at a given location on a given date. Three published criteria are supported via themethodargument::odeh(default) — Odeh (2006) empirical criterion based on 737 observations using topocentric ARCV and a Danjon limit of 6.4°.:yallop— Yallop (1997) empirical criterion based on 295 observations using geocentric ARCV.:schaefer— Schaefer (1988/2000) physics-based model computing the contrast between crescent brightness and twilight sky brightness against the human contrast detection threshold.
Add
Astro.new_visible_crescent/4accepting atmospheric options for the Schaefer method (:extinctionparameter).Add
Astro.Ephemeris.Downloaderwhich automatically downloads the JPL DE440s ephemeris file (~32 MB) from NASA NAIF on first application start and caches it under the user cache directory. The download URL and cache path can be overridden with the:ephemeris_urland:ephemerisapplication environment keys. If the download fails,Astro.Application.start/2now returns a clear error message explaining how to install the file manually.
Astro version 2.0.0
This is the changelog for Astro version 2.0.0 released on March 14th, 2026. For older changelogs please consult the release tag on GitHub
Breaking changes
Rename
Astro.Solar.solar_longitude/1toAstro.Solar.solar_ecliptic_longitude/1andAstro.Lunar.lunar_longitude/1toAstro.Lunar.lunar_ecliptic_longitude/1to use unambiguous astronomical terminology.Rename
Astro.Lunar.new_moon/0toAstro.Lunar.new_moon_phase/0,Astro.Lunar.full_moon/0toAstro.Lunar.full_moon_phase/0,Astro.Lunar.first_quarter/0toAstro.Lunar.first_quarter_phase/0, andAstro.Lunar.last_quarter/0toAstro.Lunar.last_quarter_phase/0to clarify that these return phase angle constants.Rename
Astro.Time.utc_datetime_from_terrestrial_datetime/1toAstro.Time.utc_datetime_from_dynamical_datetime/1to reflect the standard "dynamical time" terminology used in modern astronomical references.Rename functions in
Astro.Timethat had names including "datetime" and consistently use the form "date_time".Astro.Time.offset_for_zone/2now returns{:ok, offset}or raises if there is an error resolving an offset. That can happen if the time zone is unknown, if there is no time in the zone or if the result is ambiguous due to DST shift.Astro.obliquity/0now returns its value in degrees (was previously radians). The only impact is to code that directly calls this function.Astro.Earth.nutation/1now returns a 3-tuple{nutation_in_longitude, nutation_in_obliquity, obliquity}instead of a single scalar value. The first element in the tuple has the same purpose as the return value of the original function. However its value may be slightly different due to the new underlying algorithms.Astro.moon_position_at/1now returns distance to the Moon in kilometres instead of metres.Astro.sunrise/3andAstro.sunset/3now delegate toAstro.Solar.SunRiseSetwhich computes solar positions from the JPL DE440s numerical ephemeris rather than the previous NOAA/Meeus analytical polynomial series, and uses a scan-and-bisect solver rather than the previous iterative analytical formula.Improved ΔT (delta-T) computation now uses variable ΔT based on IERS observations (1972–2025) and Meeus polynomial approximations for historical dates, replacing the previous fixed ΔT value. This improves the accuracy of all astronomical calculations but changes computed times for equinoxes, solstices, new moons, and lunar phases by up to ~22 seconds compared to version 1.x.
Sunrise/sunset and moonrise/moonset bisection tolerance tightened from 1.0 second to 0.01 seconds, yielding sub-second precision.
Remove
Astro.Solar.sun_rise_or_set/3andAstro.Solar.utc_sun_position/4(the old NOAA/Meeus sunrise/sunset implementation). These functions were previously@doc falseand are superseded byAstro.Solar.SunRiseSet.
Enhancements
Add
Astro.moonrise/3andAstro.moonset/3to compute moonrise and moonset times for a given location and date.Add
Astro.date_time_new_moon_nearest/1which returns the new moon nearest to a given date or datetime.Add
Astro.Lunar.date_time_new_moon_nearest/1(takes a moment parameter).Add
Astro.Time.date_from_julian_days/1to convert Julian Day Numbers toDatestructs.Add new
Astro.Solar.SunRiseSetmodule implementing sunrise/sunset via JPL DE440s ephemeris and scan-and-bisect solver with configurable bisection tolerance.Add new
Astro.Lunar.MoonRiseSetmodule implementing fully topocentric moonrise/moonset via JPL DE440s ephemeris and scan-and-bisect solver with configurable bisection tolerance.Add new
Astro.Coordinatesmodule for coordinate system conversions.Add new types
Astro.radians/0,Astro.astronomical_units/0, andAstro.kilometers/0.Improved documentation with greater explanation of some of the key astronomical concepts.
Astro version 1.1.2
This is the changelog for Astro version 1.1.2 released on September 9th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix
Astro.sunrise/3andAstro.sunset/3when the resolved UTC datetime is ambiguous or has a gap (typically during a daylight savings transition). Thanks to @andykent for the PR. Closes #6 and #7.
Astro version 1.1.1
This is the changelog for Astro version 1.1.1 released on June 21st, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Remove
:hackneyand:tzdatafrom:extra_applications.
Astro version 1.1.0
This is the changelog for Astro version 1.1.0 released on June 18th, 2024. For older changelogs please consult the release tag on GitHub
Breaking Change
:tz_worldis no longer a required dependency - it is now an optional dependency. This library is used to resolve a time zone name from a given latitude and longitude. When configured, it becomes the default method of resolving time zone names from a location. However it is no possible to provide alternative implementations for this resolution using the:time_zone_resolveroption.To retain the previous behaviour, applications should add
{:tz_world, "~> 1.0"}to their dependencies.
Enhancements
Adds an option
:time_zone_resolvertoAstro.sunrise/3andAstro.sunset/3that is a 1-arity function that is invoked to resolve the time zone name from a given latitude and longitude. The default is to useTzWorld.timezone_at/1ifTzWorldis configured, otherwise an error is returned.The default time zone database is now detected in the following order:
- Application.get_env(:elixir, :time_zone_database)
- TzData.TimeZoneDatabase if TzData is configured
- Tz.TimeZoneDatabase if Tz is configured
Astro version 1.0.2
This is the changelog for Astro version 1.0.2 released on May 27th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix sunrise/sunset calculations when the solar elevation isn't 90 degrees. Thanks to @cloud8421 for the issue. Closes #5.
Astro version 1.0.1
This is the changelog for Astro version 1.0.1 released on April 6th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Use only the configured time zone database to resolve time zone information. Therefore any module that implements the
Calendar.TimeZoneDatabasebehaviour can be used. This also makes the code align with the README so that eitherTzdataorTzcan be configured as the systems time zone database (or any future library). Thanks to @ericlathrop for the issue. Closes #4.
Astro version 1.0.0
This is the changelog for Astro version 1.0.0 released on December 29th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
Release 1.0. This library was started four years ago and the public API has been stable for at least three of those years.
Adds
Astro.sun_azimuth_altitude/2. Thanks to @kimlai for the suggestion. Closes #3.
Astro version 0.10.0
This is the changelog for Astro version 0.10.0 released on November 7th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Adds
Astro.Math.floor/1andAstro.Math.ceil/1which are needed to supportTempo.
Astro version 0.9.2
This is the changelog for Astro version 0.9.2 released on September 1st, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Update
:tz_worldto "~> 1.0" which will also remove Elixir 1.14 warnings
Astro version 0.9.1
This is the changelog for Astro version 0.9.1 released on October 23rd, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Ensure that
gregorian_secondsis an integer before passing it toTzdata.periods_for_time/3. Thanks to @dvic for the report. Fixes #2.
Astro version 0.9.0
This is the changelog for Astro version 0.9.0 released on October 8th, 2021. For older changelogs please consult the release tag on GitHub
Please note that Elixir 1.11 or later is required.
Enhancements
- Adds
Astro.lunar_phase_emoji/1to produce a single grapheme string representing the image of the moon phase for a given lunar angle.
Astro version 0.8.0
This is the changelog for Astro version 0.8.0 released on October 3rd, 2021. For older changelogs please consult the release tag on GitHub
Please note that Elixir 1.11 or later is required.
Enhancements
Convert some identity functions to macros which improves runtime performance
Add additional specs and docs to
Astro.Mathmodule
Astro version 0.7.0
This is the changelog for Astro version 0.7.0 released on September 10th, 2021. For older changelogs please consult the release tag on GitHub
Please note that Elixir 1.11 or later is required.
Bug Fixes
- Revert
Astroback to a pure library application. The supervisor forTzWorldstill needs to be started. This fix brings the code back into line with the README. Thanks to @dvic for the report. Closes #1.
Astro version 0.6.0
This is the changelog for Astro version 0.6.0 released on September 5th, 2021. For older changelogs please consult the release tag on GitHub
Please note that Elixir 1.11 or later is required.
Bug Fixes
Fix
Astro.Math.atan_r/2Fix ephemeris calculation
Breaking changes
- Change
Time.date_time_{from, to}_iso_days/1toTime.date_time_{from, to}_moment/1
Enhancements
Remove dependency on
ex_cldr_calendarandjason
Astro version 0.5.0
This is the changelog for Astro version 0.5.0 released on August 26th, 2021. For older changelogs please consult the release tag on GitHub
Please note that Elixir 1.11 or later is required.
Bug Fixes
Updates documentation to be clear about installation and setup requirements for
tz_worldFixes test data for São Paulo now that it no longer uses DST
Ensure
:astrois started in test mode
Enhancements
This primary focus of this release is to add lunar calculations for moon phase.
Astro version 0.4.0
This is the changelog for Astro version 0.4.0 released on February 16th, 2020. For older changelogs please consult the release tag on GitHub
Breaking Change
- When no timezone is found the return is changed from
{:error, :timezone_not_found}to{:error, :time_zone_not_found}to be consistent with Elixir andTzData.
Astro version 0.3.0
This is the changelog for Astro version 0.3.0 released on December 9th, 2019. For older changelogs please consult the release tag on GitHub
Change in behaviour
- Seconds are no longer truncated to zero when calculating datetimes and durations
Enhancements
Add
Astro.solar_noon/2to return the true solar noon for a location and dateAdd
Astro.hours_of_daylight/2to return hours, minutes and seconds as aTime.t()representing the number of daylight hours for a give location and dateAdd
Astro.sun_apparent_longitude/1to return the apparent solar longitude on a given date. The result, a number of degrees between 0 and 360, can be used to determine the seasons.
Astro version 0.2.0
This is the changelog for Astro version 0.2.0 released on December 6th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
Add
Astro.equinox/2andAstro.solstice/2to calculate solstices and equinoxes for a year. From these can be derived the seasons.Add
Astro.Time.datetime_from_julian_days/1Add
Astro.Time.utc_datetime_from_terrestrial_datetime/1
Astro version 0.1.0
This is the changelog for Astro version 0.1.0 released on December 5th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Initial release includes
Astro.sunrise/3andAstro.sunset/3. See the readme for further roadmap details.