calculates the time of sunrise and sunset for a date and location and
prints the results.
In order to calculate the sunrise and sunset, the
program must know the latitude and longitude of your location. You
can pass this information to the program via environment variables or
via the command line.
To set the longitude via the command line, use the
option. Similarly, to set the latitude, use the
option. The number passed must be a floating point representation of
the degrees of longitude or latitude. Locations west of the prime
meridian are represented as positive numbers, those located east of
GMT are negative numbers. North latitudes are positive, while south
latitudes are negative. For example, the longitude of Walnut Creek,
California, is 122.06 and its latitude is 37.90.
The program will also search the environment for the variables
The format of these variables is exactly the same as on the command
will print the sunrise and/or sunset for the current date. You may
change the date being calculated by using the
options to set the month and day. The month must be a number from 1 to
12, while the day must be from 1 to 31. Times are printed out in the
default representation for the locale.
To restrict the output, use the
flag to print only the sunrise or sunset respectively.
To print a series of times, use the
option to pass the number of dates to print out.
The calculations are an approximation and may be wrong by as much as
When calculating times for areas above the Arctic or below the
Antarctic Circles, the program will report the times for the nearest
(chronologically) sunrise and sunset. The year reported will be
incorrect sometimes, but the day of year will be correct.
Sunrise and sunset times are calculated internally to GMT, and
displayed in the local timezone. If the coordinates given dont match
the current timezone setting, expect results that are off by a number