'Display date in SR format
TODO: Rename this to srfdate
:param dt: datetime object
:param d_preset: Preset date format
:return: date string'

@static_or_instance
def srfdate(self, dt=None, d_preset=None):

    try:
        locale.setlocale(locale.LC_TIME, u'')
    except Exception:
        pass
    strd = u''
    try:
        if (self is None):
            if (dt is not None):
                if (d_preset is not None):
                    strd = dt.strftime(d_preset)
                else:
                    strd = dt.strftime(sickrage.srCore.srConfig.DATE_PRESET)
        elif (d_preset is not None):
            strd = self.strftime(d_preset)
        else:
            strd = self.strftime(sickrage.srCore.srConfig.DATE_PRESET)
    finally:
        try:
            locale.setlocale(locale.LC_TIME, u'')
        except Exception:
            pass
    return strd
