Skip to content

Instantly share code, notes, and snippets.

@mlissner
Created November 24, 2014 18:40
Show Gist options
  • Save mlissner/52f2a6fc681846865b00 to your computer and use it in GitHub Desktop.
Save mlissner/52f2a6fc681846865b00 to your computer and use it in GitHub Desktop.
Another attempt at nuking stftime.
import datetime
import warnings
class CleanDateTime(datetime.datetime):
def strftime(self, *args, **kwargs):
# warnings.warn('strftime is deprecated', DeprecationWarning,
# stacklevel=2)
return super(CleanDateTime, self).strftime(*args, **kwargs)
class CleanDate(datetime.date):
def strftime(self, *args, **kwargs):
# warnings.warn('strftime is deprecated', DeprecationWarning,
# stacklevel=2)
return super(CleanDate, self).strftime(*args, **kwargs)
datetime.datetime = CleanDateTime
datetime.date = CleanDate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment