So, the old project was transferred to me by another employee. It is badly coded and almost made me quit work. Twice. Because I do not have much time (I was given 2 weeks for this task), I can not rewrite all this. I changed it as I was asked, and I'm currently doing tests. The problem is that the code must change its behavior in other years. The problem with this problem is that there is no central location where the current year is set, and all the code using date("Y")that will make me change about 200 files.
So, the easiest solution would be to tell PHP at the beginning: "Hey, year 20xx." I tried date_default_timezone_set(), but that didn't help me at all. So I'm looking for:
- PHP command that changes the current year to a given value (for example,
Set_Date("Y", 2016);) - Apache-Server command that changes the current time (for example,
setdate -Y 2016)
Is there any way, or at least a workaround, to make the script another year?
source
share