Frank Koehl's Avatar

Frank Koehl

02 Oct, 2009 06:36 PM

How does CG decide what timezone to store and display information in, particularly the data returned by the API?

My own tests show the timezone coming back in API calls as +00:00, however the example on the Transaction Post Hook page shows a timezone adjustment for the value in transaction[transactedDatetime].

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.

  1. Support Staff 1 Posted by Marc Guyer on 02 Oct, 2009 10:37 PM

    Marc Guyer's Avatar

    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.

    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.

    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.

    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.

  2. 2 Posted by Frank Koehl on 02 Oct, 2009 11:05 PM

    Frank Koehl's Avatar

    Exactly the information I needed. Thanks, Marc.

  3. Marc Guyer closed this discussion on 11 Apr, 2010 10:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac