Sunset

Sunset[]
gives the time of the next sunset for the current date and location.

Sunset[datespec]
gives the time of the next sunset for the specified dates.

Sunset[locationspec]
gives the times of the next sunset for the specified locations.

Sunset[locationspec,datespec]
gives the time of the next sunset for the specified date and location.

Sunset[{{location1,date1},{location2,date2},}]
gives the times of the next sunset for all specified locations on the specified dates.

Sunset[locationspec,datespec,func]
uses func to determine what to return for extended locations.

Details and OptionsDetails and Options

  • Sunset[] makes use of $GeoLocation and $TimeZone to determine your location and time zone.
  • Results are given to minute resolution in the specified TimeZone.
  • Locations can be specified as Entity objects, assuming they represent objects with geographic coordinates or GeoGraphics primitives, or they can be latitude/longitude pairs, assuming degrees as units.
  • Dates can be specified as a DateObject or as a string that resolves to a date.
  • 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 for compatibility with DateRange specifications.
  • Sunset[,func] is used to specify the format of output when 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 sunset with date and time inferred for time zone z by assuming that your computer is set for the time zone specified by $TimeZone.
  • Sunset[TimeDirection->-1] gives the date of the last sunset.
  • Sunset can accept the following options:
  • TimeDirection1whether to return the next or last Sunrise
    TimeZone$TimeZonetime zone to be used for dates
  • Possible settings for TimeDirection include:
  • 1returns the next sunset from the specified date
    -1returns the last sunset from the specified date

ExamplesExamplesopen allclose all

Basic Examples  (6)Basic Examples  (6)

Compute the next sunset for your current location:

In[1]:=
Click for copyable input
Out[1]=

Compute the next sunset after a specified date:

In[1]:=
Click for copyable input
Out[1]=

Compute the next sunset for a specified location:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Compute the next sunset for a specified city and date:

In[1]:=
Click for copyable input
Out[1]=

Generate the time of the next sunset:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)