[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

AD.7 Times of Sunrise and Sunset

Special calendar commands can tell you, to within a minute or two, the times of sunrise and sunset for any date.

S

Display times of sunrise and sunset for the selected date (calendar-sunrise-sunset).

Mouse-2 Sunrise/sunset

Display times of sunrise and sunset for the date you click on.

M-x sunrise-sunset

Display times of sunrise and sunset for today's date.

C-u M-x sunrise-sunset

Display times of sunrise and sunset for a specified date.

Within the calendar, to display the local times of sunrise and sunset in the echo area, move point to the date you want, and type S. Alternatively, click Mouse-2 on the date, then choose `Sunrise/sunset' from the menu that appears. The command M-x sunrise-sunset is available outside the calendar to display this information for today's date or a specified date. To specify a date other than today, use C-u M-x sunrise-sunset, which prompts for the year, month, and day.

You can display the times of sunrise and sunset for any location and any date with C-u C-u M-x sunrise-sunset. This asks you for a longitude, latitude, number of minutes difference from Coordinated Universal Time, and date, and then tells you the times of sunrise and sunset for that location on that date.

Because the times of sunrise and sunset depend on the location on earth, you need to tell Emacs your latitude, longitude, and location name before using these commands. Here is an example of what to set:

 
(setq calendar-latitude 40.1)
(setq calendar-longitude -88.2)
(setq calendar-location-name "Urbana, IL")

Use one decimal place in the values of calendar-latitude and calendar-longitude.

Your time zone also affects the local time of sunrise and sunset. Emacs usually gets time zone information from the operating system, but if these values are not what you want (or if the operating system does not supply them), you must set them yourself. Here is an example:

 
(setq calendar-time-zone -360)
(setq calendar-standard-time-zone-name "CST")
(setq calendar-daylight-time-zone-name "CDT")

The value of calendar-time-zone is the number of minutes difference between your local standard time and Coordinated Universal Time (Greenwich time). The values of calendar-standard-time-zone-name and calendar-daylight-time-zone-name are the abbreviations used in your time zone. Emacs displays the times of sunrise and sunset corrected for daylight savings time. See section Daylight Savings Time, for how daylight savings time is determined.

As a user, you might find it convenient to set the calendar location variables for your usual physical location in your `.emacs' file. And when you install Emacs on a machine, you can create a `default.el' file which sets them properly for the typical location of most users of that machine. @xref{Init File}.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Roberto on abril, 2 2007 using texi2html 1.76.