Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Generalize integer timestamp handling #227

Merged
merged 1 commit into from
Aug 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion influxdb/line_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
from calendar import timegm
from copy import copy
from datetime import datetime
from numbers import Integral

from dateutil.parser import parse
from six import binary_type, text_type


def _convert_timestamp(timestamp, precision=None):
if isinstance(timestamp, int):
if isinstance(timestamp, Integral):
return timestamp # assume precision is correct if timestamp is int
if isinstance(_get_unicode(timestamp), text_type):
timestamp = parse(timestamp)
Expand Down