ChineseZodiac(yyyy)
Last updated December 3, 2001
Version: 1 | Requires: ColdFusion 5 | Library: DateLib
Description:
Returns the Chinese Zodiac animal corresponding to the given year of birth. Takes any year, positive or negative. All years will be taken at face value, for example 73 will be the year 73 A.D., not 1973.
Return Values:
Returns a string.
Example:
ChineseZodiac(69) = #ChineseZodiac(69)#<br>
ChineseZodiac(1969) = #ChineseZodiac(1969)#<br>
ChineseZodiac(1973) = #ChineseZodiac(1973)#<br>
ChineseZodiac(1976) = #ChineseZodiac(1976)#<br>
ChineseZodiac(-1200) = #ChineseZodiac(-1200)#<br>
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| yyyy | Year (in the format yyyy) you want the Chinese Zodiac animal for. | Yes |
Full UDF Source:
<cfscript>
/**
* Returns the Chinese Zodiac animal corresponding to the given year of birth.
*
* @param yyyy Year (in the format yyyy) you want the Chinese Zodiac animal for.
* @return Returns a string.
* @author Sierra Bufe (sierra@brighterfusion.com)
* @version 1, December 3, 2001
*/
function ChineseZodiac(yyyy) {
var Animals = ListToArray("Monkey,Chicken,Dog,Pig,Mouse,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Sheep");
return Animals[(yyyy MOD 12) + 1];
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
11 day(s) ago
Will Belden added
longTime
17 day(s) ago
James Sleeman added
quickSort
27 day(s) ago
Ben Forta added
GetHostAddress
30 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)