Created
December 15, 2011 00:32
-
-
Save thobbs/1479283 to your computer and use it in GitHub Desktop.
Pycassa DateTimeString Replacement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DatetimeStingType(pycassa.types.CassandraType): | |
def __init__(self): | |
self.pack = lambda dtime: dtime.strftime('%Y-%m-%d') | |
self.unpack = lambda dtime_str: datetime.strptime('%Y-%m-%d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment