Module:Zodiac date
Jump to navigation
Jump to search
This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
Usage
{{#invoke:Zodiac date|main|sign number|[year]}}
where sign number is the number of the astrological sign, explained in the table below. Year is the year in which the Sun enters the sign; in the case of Capricorn the date for leaving the sign will be in January of the following year. The time scale is UT1, which is similar to Greenwich Mean Time. The supported range is 2015 to 2050, including all the signs in 2050 except Capricorn (because it begins in December and no data is available for the end date of the sign in January 2051).
Value | Sign |
---|---|
1 | Aries |
2 | Taurus |
3 | Gemini |
4 | Cancer |
5 | Leo |
6 | Virgo |
7 | Libra |
8 | Scorpio |
9 | Sagittarius |
10 | Capricorn |
11 | Aquarius |
12 | Pisces |
References
- Lua error: bad argument #1 to "get" (not a valid title). Longitude of Sun, apparent geocentric ecliptic of date, interpolated to find time of crossing 0°, 30°....
-- Module:Zodiac date
local p = {}
function p.main( frame )
local signNumber = tonumber(frame.args[1]) or 1
local year = tonumber(frame.args[2]) or os.date("!*t").year
--<span style="color:red">red writing</span>
if (year < 2015) or (year > 2050) or ((year == 2050) and (signNumber == 10)) then
return '<span style="color:red">Error: Only 2015-2050 '..
'(except Capricorn 2050) are supported.</span>'
end
--Template being replaced starts with Aries, which starts at 0 deg. longitude,
--but we want to start with Aquarius, the sign that begins in January.
local sn = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2}
signNumber = sn[signNumber]
year = year-2015
local zd = {
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 20", "June 21",
"July 22", "August 23", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 20", "June 21",
"July 22", "August 23", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 23", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 23", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 22",
"January 20", "February 19", "March 19", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 23", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 22", "August 23", "September 23", "October 23", "November 22", "December 21",
"January 20", "February 18", "March 19", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 20",
"July 22", "August 22", "September 22", "October 22", "November 21", "December 21",
"January 19", "February 18", "March 20", "April 19", "May 20", "June 21",
"July 22", "August 22", "September 22", "October 23", "November 22", "December 21",
}
return zd[signNumber+12*year].." – "..zd[1+signNumber+12*year]
end
return p