Skip to content

Commit abc53ee

Browse files
committed
Correctly parse timezones for mixin timestamps.
1 parent 084468f commit abc53ee

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
v1.3, 2017-01-10 -- Correctly parse timezone for mixin timestamps.
12
v1.2, 2017-01-10 -- Synchronization methods instead of fetch factories.
23
v1.1, 2017-01-10 -- SQLAlchemy mixins, optional webhook.
34
v1.0, 2017-01-09 -- Initial release.

Diff for: flask_fastspring.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
from datetime import datetime
44
from flask import Markup, current_app, render_template_string
5+
from psycopg2.tz import FixedOffsetTimezone
56
from sqlalchemy import Boolean, Column, DateTime, Text
67
from sqlalchemy.dialects.postgresql import JSON
78
from sqlalchemy.ext.declarative import declared_attr
89
from sqlalchemy.orm import deferred
910

1011

12+
UTC = FixedOffsetTimezone(offset=0)
13+
14+
1115
class FastSpringAPIError(Exception):
1216

1317
def __init__(self, response):
@@ -166,4 +170,4 @@ def synchronize(self):
166170

167171

168172
def milliseconds_to_datetime(m):
169-
return datetime.utcfromtimestamp(m / 1000)
173+
return datetime.utcfromtimestamp(m / 1000).replace(tzinfo=UTC)

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='Flask-FastSpring',
5-
version='1.2',
5+
version='1.3',
66
description='FastSpring API integration for Flask',
77
py_modules=['flask_fastspring'],
88
install_requires=[

0 commit comments

Comments
 (0)