How to use the feedgenerator.django.utils.datetime_safe.new_datetime function in feedgenerator

To help you get started, we’ve selected a few feedgenerator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getpelican / feedgenerator / feedgenerator / django / utils / View on Github external
def get_tag_uri(url, date):
    Creates a TagURI.

    bits = urlparse(url)
    d = ''
    if date is not None:
        d = ',%s' % datetime_safe.new_datetime(date).strftime('%Y-%m-%d')
    fragment = ''
    if bits.fragment != '':
        fragment = '/%s' % (bits.fragment)
    return 'tag:%s%s:%s%s' % (bits.hostname, d, bits.path, fragment)