Convert getNumericDate() integer back to date

Hey all, I am trying to loop from one date to another and thought converting the start and end dates to integers using getNumericDate() could work, but I’m not finding a function that reverts the integer back to yyyy-mm-dd. I looked at the cflib epochTime, but it uses 1970-01-01 instead of 1899-12-30 (two days before 1900?!?) and needs to be in seconds, not days.

This is what I’ trying to do:

<cfloop from="#getNumericDate(dateStart)#" to="#getNumericDate(dateEnd)#" index="dateNum"> convert datenum back into yyyy-mm-dd </cfloop>

Perhaps I should do a cfloop condition instead, and increment the normal yyyy-mm-dd date using dateAdd() instead?

In either event, how would we convert a getNumericDate() integer back to date?

@Michael_Muller using to dateformat(dateNum,“yyyy-mm-dd”) works for me

You don’t need to convert the dates to numbers. Lucee will do that for you:

D’oh. Of course. And thanks for the two examples. I did the cfloop condition, but may switch it back to this 'cause it’s easier to read.