dayOfYearReverse(currentDayOfYear [, currentYear])
Last updated September 7, 2007
Version: 3 | Requires: ColdFusion MX | Library: DateLib
Description:
This function accepts the day of the year (One way to get that is with the DayOfYear function) and the year. It returns the date object for the given day of the year.
Return Values:
Returns a date.
Example:
#dayOfYearReverse(dayOfYear(now()))#
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| currentDayOfYear | Numerical day of the year. | Yes |
| currentYear | The year. Defaults to this year. | No |
Full UDF Source:
<!---
This is the opposite of CFs DayOfYear function.
v2 bug fix by David Levin (dave@angrysam.com)
v3 fix by Christopher Jordan
@param currentDayOfYear Numerical day of the year. (Required)
@param currentYear The year. Defaults to this year. (Optional)
@return Returns a date.
@author Jeff Houser (dave@angrysam.comjeff@farcryfly.com)
@version 3, September 7, 2007
--->
<cffunction name="dayOfYearReverse" returntype="date" hint="Accepts the day of Year (Integer) and year in question, and returns the date" output="false">
<cfargument name="currentDayOfYear" type="numeric" required="yes">
<cfargument name="currentYear" type="numeric" default="#year(now())#" required="no">
<cfreturn dateAdd("d",arguments.currentDayOfYear, createDate(arguments.currentyear-1,"12","31" ))>
</cffunction>
Search CFLib.org
Latest Additions
Dave Anderson added
iniToStruct
20 day(s) ago
Dave Anderson added
deDupeArray
20 day(s) ago
Richard added
dice
22 day(s) ago
Isaac Dealey added
getRelative
a while ago
Top Rated
backupDatabase
Rated 5.0, 22 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)
highlightAndCrop
Rated 5.0, 4 time(s)