Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Current template's modify date

Tags:

coldfusion

On my application.cfc file, I would like to have set a variable:

 application.gsversion = "Version 0.1.#year(x)#.#month(x)#.#day(x)#";

where x has the application.cfc's current modified date.

like image 404
James A Mohler Avatar asked Mar 07 '26 11:03

James A Mohler


1 Answers

Add something like this to your onApplicationStart() method in Application.cfc:

var objAppFile = fileopen(expandpath('./Application.cfc'), 'read');
application.gsversion = "Version 0.1.#year(objAppFile.lastmodified)#.#month(objAppFile.lastmodified)#.#day(objAppFile.lastmodified)#";
fileclose(objAppFile);
like image 89
azawaza Avatar answered Mar 09 '26 07:03

azawaza