josephernest/TinyAnalytics

Timezone issue

Opened this issue · 1 comments

On my server (PHP 5.5.9-1ubuntu4.7) :

  • adding tracker.php at the end of a index.php that doesn't call date_default_timezone_set results in local-server-timezone for date

  • adding tracker.php at the end of a index.php that does call date_default_timezone_set (e.g. in a Wordpress site) results in using UTC-timezone for date

Related topic: http://stackoverflow.com/questions/41603688/get-time-with-local-servers-timezone-after-a-date-default-timezone-set-call

Now half done thanks to last commits.

Second half to do: when displaying charts, JavaScript uses client-side date/time and this can differ from server-side date/time. Todo: server should send dates to client here.