I have defined some constants in yii components.
component/Interst.php
class Interst {
Const Rate = 15.6%
Const Service_tax_rate = 14.5%
}
I am using this in my controllers like Interest::Service_tax_rate
. I want to change this rate on 31st May 2016
to 15.0%
this should be active from 12 AM
(at night) of 31st
. How can I code so that this would change automatically after 31st
night?
I have tried this in Interest.php
if(date('d/m/Y H:i:s') == '31/05/2016 00:00:00'){
Const Service_tax_rate = 15%;
}
but this doesn't work as a condition - it's causing an error