Fix to passing a string as second param to date()

date expects timestamp as second parameter. used strtotime to fix that.