Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复时区错误 #7

Merged
merged 1 commit into from Dec 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions meican/models.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

from datetime import datetime
from datetime import datetime, timedelta, timezone
from enum import Enum

import six
Expand Down Expand Up @@ -61,7 +61,7 @@ def __init__(self, data):
:type data: dict
"""
self.title = data['title']
self.target_time = datetime.fromtimestamp(int(data['targetTime']) / 1000)
self.target_time = datetime.fromtimestamp(int(data['targetTime']) / 1000, tz=timezone(timedelta(hours=8)))
self.status = TabStatus.parse(data['status'])
self.uid = data['userTab']['uniqueId']
self.addresses = [Address(_) for _ in data['userTab']['corp']['addressList']]
Expand Down