python类TIME_FORMAT的实例源码

defaultfilters.py 文件源码 项目:CodingDojo 作者: ComputerSocietyUNB 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def time(value, arg=None):
    """Formats a time according to the given format."""
    if value in (None, ''):
        return ''
    if arg is None:
        arg = settings.TIME_FORMAT
    try:
        return formats.time_format(value, arg)
    except AttributeError:
        try:
            return time_format(value, arg)
        except AttributeError:
            return ''
blog_tags.py 文件源码 项目:DjangoBlog 作者: liangliangyy 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def timeformat(data):
    try:
        return data.strftime(settings.TIME_FORMAT)
        # print(data.strftime(settings.TIME_FORMAT))
        # return "ddd"
    except:
        return ""
timecolumn.py 文件源码 项目:extractfacts 作者: oneroyalace 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, format=None, *args, **kwargs):
        if format is None:
            format = settings.TIME_FORMAT
        template = '{{ value|date:"%s"|default:default }}' % format
        super(TimeColumn, self).__init__(template_code=template, *args, **kwargs)
timecolumn.py 文件源码 项目:extractfacts 作者: oneroyalace 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, format=None, *args, **kwargs):
        if format is None:
            format = settings.TIME_FORMAT
        template = '{{ value|date:"%s"|default:default }}' % format
        super(TimeColumn, self).__init__(template_code=template, *args, **kwargs)
defaultfilters.py 文件源码 项目:djanoDoc 作者: JustinChavez 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def time(value, arg=None):
    """Formats a time according to the given format."""
    if value in (None, ''):
        return ''
    if arg is None:
        arg = settings.TIME_FORMAT
    try:
        return formats.time_format(value, arg)
    except AttributeError:
        try:
            return time_format(value, arg)
        except AttributeError:
            return ''
defaultfilters.py 文件源码 项目:django-next-train 作者: bitpixdigital 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def time(value, arg=None):
    """Formats a time according to the given format."""
    if value in (None, ''):
        return ''
    if arg is None:
        arg = settings.TIME_FORMAT
    try:
        return formats.time_format(value, arg)
    except AttributeError:
        try:
            return time_format(value, arg)
        except AttributeError:
            return ''
defaultfilters.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def time(value, arg=None):
    """Formats a time according to the given format."""
    if value in (None, ''):
        return ''
    if arg is None:
        arg = settings.TIME_FORMAT
    try:
        return formats.time_format(value, arg)
    except AttributeError:
        try:
            return time_format(value, arg)
        except AttributeError:
            return ''


问题


面经


文章

微信
公众号

扫码关注公众号