Fixed PHP syntax issues, use SQL for datetime
Merge pull request #22 from aasav/master

Style Fixes