This file contains 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
import datetime as dt | |
class datetime(dt.datetime): | |
"""The standard datetime class with the added support for the % and // | |
operators. | |
Refer to https://gist.github.com/treyhunner/6218526 | |
""" | |
def __divmod__(self, delta): | |
seconds = int((self - dt.datetime.min.replace(tzinfo = self.tzinfo)).total_seconds()) |