Closed tisdall closed 8 years ago
Thanks for the note, @tisdall. You are correct that timestamps from the Python library are currently returned as UTC values with no timestamp (default assumption being UTC).
We will consider adding timezone specificity to the datetime objects in a future library release, but at this point introducing such a change would break a lot of backwards compatability.
For others that may find this issue, here's the quickest pytz
way to add timezone details to dates (assuming you know that the datetime is already naive UTC like in this library):
import pytz
transaction = braintree.Transaction.find("my_transaction_id")
created_at_utc = transaction.created_at.replace(tzinfo=pytz.utc)
Happy Holidays!
The docs mention than search results and such are always in UTC, but the datetime.datetime objects being created with this library are not timezone aware. I can understand not wanting to add pytz just to accomplish this, so you could define your own UTC object (as shown in the datetime docs) that could be used in this case.