– Common Function Library Project

dayOfYearReverse(currentDayOfYear[, currentYear])

Last updated September 7, 2007


Jeff Houser

Version: 3 | Requires: CF6 | Library: DateLib

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.




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 (
 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 ( 
 @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" ))>
blog comments powered by Disqus


Latest Additions

Kevin Cotton added
May 5, 2016

Raymond Camden added
April 25, 2016

Chris Wigginton added
January 18, 2016

Gary Stanton added
November 19, 2015

Sebastiaan Naafs - van Dijk added
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson