'Show datetime in SR format
TODO: Rename this to srfdatetime
:param dt: datetime object
:param show_seconds: Boolean, show seconds as well
:param d_preset: Preset date format
:param t_preset: Preset time format
:return: datetime string'

@static_or_instance
def sbfdatetime(self, dt=None, show_seconds=False, d_preset=None, t_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(sickbeard.DATE_PRESET)
                try:
                    if sbdatetime.has_locale:
                        locale.setlocale(locale.LC_TIME, u'en_US')
                except Exception:
                    try:
                        if sbdatetime.has_locale:
                            locale.setlocale(locale.LC_TIME, sbdatetime.en_US_norm)
                    except Exception:
                        sbdatetime.has_locale = False
                if (t_preset is not None):
                    strd += (u',    ' + dt.strftime(t_preset))
                elif show_seconds:
                    strd += (u',    ' + dt.strftime(sickbeard.TIME_PRESET_W_SECONDS))
                else:
                    strd += (u',    ' + dt.strftime(sickbeard.TIME_PRESET))
        else:
            if (d_preset is not None):
                strd = self.strftime(d_preset)
            else:
                strd = self.strftime(sickbeard.DATE_PRESET)
            try:
                if sbdatetime.has_locale:
                    locale.setlocale(locale.LC_TIME, u'en_US')
            except Exception:
                try:
                    if sbdatetime.has_locale:
                        locale.setlocale(locale.LC_TIME, sbdatetime.en_US_norm)
                except Exception:
                    sbdatetime.has_locale = False
            if (t_preset is not None):
                strd += (u',    ' + self.strftime(t_preset))
            elif show_seconds:
                strd += (u',    ' + self.strftime(sickbeard.TIME_PRESET_W_SECONDS))
            else:
                strd += (u',    ' + self.strftime(sickbeard.TIME_PRESET))
    finally:
        try:
            if sbdatetime.has_locale:
                locale.setlocale(locale.LC_TIME, u'')
        except Exception:
            sbdatetime.has_locale = False
    return strd.decode(sickbeard.SYS_ENCODING)
