tag:support.getcheddar.com,2009-06-01:/discussions/questions/32-timezonesCheddar: Discussion 2018-10-18T14:43:13Ztag:support.getcheddar.com,2009-06-01:Comment/4214472009-10-02T18:36:21Z2010-04-09T17:29:54ZTimezones<div><p>How does CG decide what timezone to store and display
information in, particularly the data returned by the API?</p>
<p>My own tests show the timezone coming back in API calls as
+00:00, however the example on the <a href=
"http://support.cheddargetter.com/faqs/api-8/transaction-post-hook">
Transaction Post Hook page</a> shows a timezone adjustment for the
value in <code>transaction[transactedDatetime]</code>.</p>
<p>For what it's worth, I'd prefer to see everything set in GMT or
UTC, and let me deal with timezones on my end.</p></div>Frank Koehltag:support.getcheddar.com,2009-06-01:Comment/4214472009-10-02T22:37:36Z2009-10-02T22:37:36ZTimezones<div><p>At a glance, this might be a bug but it doesn't really matter
anyway. The system is designed to use the timezone set for the user
that is currently authenticated to the system. This is working
correctly for the transaction post hook test page that you mention.
In other words, it's working correctly in the GUI which is really
the only place where it matters.<br></p>
<p>Our servers are set to UTC and so the transaction post will have
a timezone offset of +00:00 in a live implementation when the
transaction is automatically generated by CG. If the transaction is
generated via the GUI (a setup fee transaction for a new customer
entered in the GUI, for example) the timezone offset will be based
on the logged in user's preference. The example shown has the
+04:00 offset because the user that generated the test (via the
GUI) was set to Eastern time.<br></p>
<p>The timezone offset is specified using the standard ISO 8601
date format to solve for cross-system timezone issues. If I recall,
you're using PHP... you can get a UNIX timestamp value using the
strtotime() which will give you an accurate time representation
whether the offset is UTC or any other timezone offset. This is
your best bet anyway but... if this is a bug, it may get fixed down
the road so any other method of interpreting the datetime could be
flawed.</p>
<p>If you would like the offset to always be represented in UTC,
you can create another user that has access to your product account
and set that user's timezone preference to UTC.</p></div>Marc Guyertag:support.getcheddar.com,2009-06-01:Comment/4214472009-10-02T23:05:26Z2010-04-09T17:29:54ZTimezones<div><p>Exactly the information I needed. Thanks, Marc.</p></div>Frank Koehl