How to use the pelican.utils.get_date function in pelican

To help you get started, we’ve selected a few pelican 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 AcrDijon / henet / henet / rst / parse.py View on Github external
def get_date(data):
    """Add tzinfo"""
    res = _get_date(data)
    # assuming UTC by default
    if res.tzinfo is None:
        res = pytz.utc.localize(res)
    return res
github grupydf / grupydf.github.io / .plugins / sitemap / sitemap.py View on Github external
def get_date_modified(self, page, default):
        if hasattr(page, 'modified'):
            if isinstance(page.modified, datetime):
                return page.modified
            return get_date(page.modified)
        else:
            return default