removed usage of php 5.3 date functions so it will work in 5.2 also