Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Caruccio committed Mar 7, 2012
2 parents bb29fe6 + 0e76966 commit d813423
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pycassa/types.py
Expand Up @@ -117,8 +117,13 @@ class DateType(CassandraType):

def _to_timestamp(v, use_micros=False):
# Expects Value to be either date or datetime
scale = 1e6 if use_micros else 1e3
micro_scale = 1.0 if use_micros else 1e3
if use_micros:
scale = 1e6
micro_scale = 1.0
else:
scale = 1e3
micro_scale = 1e3

try:
converted = time.mktime(v.timetuple())
converted = (converted * scale) + \
Expand Down

0 comments on commit d813423

Please sign in to comment.