TimeZone Issue

Asked by d4lamar

Hi All,

I have just installed graphite and I am doing some tests.

I have problems to understand how to display correct timestamps.

I am in "Europe/Zurich" timezone (UTC+2) and I am sending test values via TCP/IP using the example method "date +%s" timestamp.

I set the following timezone configuration:
/opt/graphite/webapp/graphite/settings.py:TIME_ZONE = 'UTC'
/opt/graphite/webapp/graphite/local_settings.py:TIME_ZONE = 'UTC'

When I do a simple query like this via webapp:
http://${GRAPHITE_SERVER}/render?target=${NAME}&format=json

I get timestamp shifted in "UTC-5" (-7 hours from my localtime), I suppose "America/Chicago" timezone.

When I add to the URL the string &tz='Europe/Zurich' I gain 2 hours and come to -5 from my localtime.

It looks to me that Graphite is still using "America/Chicago" timezone , conversion and display but it believes to be in UTC instead.

Any help will be appreciated.

Thanks In Advance,
d4lamar

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
d4lamar
Solved:
Last query:
Last reply:
Revision history for this message
Denis Zhdanov (deniszhdanov) said :
#1

Internally Graphite uses UTC only. So, please send time only in UTC format when sending data to Graphite and put your timezone in /opt/graphite/webapp/graphite/local_settings.py
And which version of Graphite are you using btw? IIRC 0.9.13-rc has some time related bugs.

Revision history for this message
d4lamar (d4lamar) said :
#2

Thanks Denis for your prompt answer.

I am using latest version installed from source from the git sources 2 days ago, the webapp says "WEBAPP_VERSION = '0.10.0-alpha'"
I don't know if there is a better way to define my version.

Indeed I did how you told me but I found the issue outside graphite.

To send epoch time to carbon I was converting timestamp to epoch using "date" system util and I was not aware about this behaviour:

$ date -d "2015-08-23T09:14:29"
Sun Aug 23 04:14:29 CEST 2015

$ date -d "2015-08-23 09:14:29"
Sun Aug 23 09:14:29 CEST 2015

I was converting timestamp with T separator to epoch time and this is was the cause of the time shift.

 Thanks and Best Regards,
d4lamar