gives the time of the next sunrise for the current date and location.


gives the times of the next sunrise for the specified dates.


gives the times of the next sunrise for the specified locations.


gives the time of the next sunrise for the specified date and location.


gives the times of the next sunrise for all specified locations on the specified dates.


uses func to determine what to return for extended locations.

Details and Options

  • Sunrise, also known as sunup, is defined as the instant of time when the upper rim of the Sun's disk appears to make contact with the horizon as it is rising.
  • The observation location can be any point on the surface of a body in the solar system, defining the local horizon.
  • Locations can be specified as Entity objects, assuming they represent objects with geographic coordinates, or they can be latitude/longitude pairs, assuming degrees as units.
  • Sunrise[] makes use of $GeoLocation and $TimeZone to determine your location and time zone.
  • datespec can be a DateObject expression, a TimeObject expression, a date string or a {y,m,d,h,m,s} date list.
  • datespec is assumed to be in $TimeZone, unless it is a DateObject or TimeObject expression with an explicit TimeZone option value.
  • locationspec and datespec can be either individual items or lists of them.
  • If datespec is a list of dates, then the results will contain EventSeries objects.
  • datespec can be specified as {start,end,increment} for compatibility with DateRange specifications.
  • Sunrise[,func] is used to specify the format of output when extended locations are specified.
  • Possible settings for func include:
  • Automaticreturns intervals for extended locations only
    Intervalreturns intervals for all specified locations
    Meanreturns mean value for extended locations
    Minreturns minimum values for extended locations
    Maxreturns maximum values for extended locations
    StandardDeviationreturns standard deviation for extended locations
  • Sunrise[TimeZone->z] gives the date of the next sunrise with date and time inferred for time zone z by assuming that your computer is set for the time zone specified by $TimeZone.
  • Sunrise[TimeDirection->-1] gives the date of the last sunrise.
  • Sunrise can accept the following options:
  • TimeDirection 1whether to return the next or last Sunrise
    TimeZone $TimeZonetime zone to be used for dates
  • Possible settings for TimeDirection include:
  • 1returns the next sunrise from the specified date
    -1returns the last sunrise from the specified date
  • Calculations are based on atmospheric refraction models that cannot be accurately predicted. This, combined with local topography deviations, can result in errors on the order of several minutes from actual observed times.


open allclose all

Basic Examples  (6)

Compute the next sunrise for your current location:

Compute the next sunrise after a specified date:

Compute the next sunrise for a specified location:

Compute the next sunrise for a specified latitude/longitude and date:

Compute the next sunrise for a specified city and date:

Generate the time of the next sunrise:

Scope  (13)

Dates  (4)

Dates can be specified as a DateObject:

Dates can be specified as a date string:

Dates can be specified as a TimeObject:

Generate the next sunrise for a range of dates:

Locations  (7)

Locations can be latitude/longitude pairs:

Locations can include elevation:

Cities are treated as single, specific locations:

Results for extended locations are intervals, by default:

The form of the results for extended locations can be overridden:

Locations can also be off Earth:

Generate the next sunrise for multiple locations:

Time Zones  (2)

Express the next sunrise at your geo location in the GMT time zone:

Find the sunrise for a specified location and time in GMT:

Options  (2)

TimeZone  (1)

Find the sunrise in Greenwich, United Kingdom:

TimeDirection  (1)

Find the last sunrise for your location:

Applications  (2)

Next sunrise from the capital cities of South America:

Determine your final location if you walk toward the Sun from sunrise to sunset at a constant speed:

Iterate the bearing in 10-minute increments to obtain a new course and destination:

Visualize the resulting path:

Find the distance between the starting and ending points:

Properties & Relations  (3)

By default, location is specified by $GeoLocation and the date is specified by the current date:

Results are in the form of an EventSeries when a range of dates is specified:

Calculate the next sunrise, defined as when the upper edge of the Sun's apparent disk touches the horizon:

Find the position of the center of the Sun at that time:

The altitude of the Sun corresponds to its angular radius:

Eliminating atmospheric refraction effects, the true position of the Sun is revealed to be even further below the horizon at sunrise:

Possible Issues  (3)

Since the value of $TimeZone may change throughout the year, the results for specified dates may vary depending on when you evaluate the input:

If the above behavior is a concern, the TimeZone option can be used to enforce a consistent value:

With Sunrise[locationspec,Interval], results for specific locations are coerced into intervals:

Sunrise returns values taking into account atmospheric refraction effects:

These effects are especially large near the horizon, but the effects are turned off a few degrees below the horizon:

Use the "TrueAltitude" method to deactivate atmospheric refraction and compare with the previous result:

Neat Examples  (4)

Plot the position of the Sun for your location between sunrise and sunset for the solstices and equinox:

Generate a map of Italy with the illumination set for sunrise:

Generate a table of sunrises for the capital cities in Europe and display only the first and last five:

Plot the length of daylight throughout a given year:

Wolfram Research (2014), Sunrise, Wolfram Language function, (updated 2023).


Wolfram Research (2014), Sunrise, Wolfram Language function, (updated 2023).


Wolfram Language. 2014. "Sunrise." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023.


Wolfram Language. (2014). Sunrise. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2023_sunrise, author="Wolfram Research", title="{Sunrise}", year="2023", howpublished="\url{}", note=[Accessed: 06-December-2023 ]}


@online{reference.wolfram_2023_sunrise, organization={Wolfram Research}, title={Sunrise}, year={2023}, url={}, note=[Accessed: 06-December-2023 ]}