Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Convert a datetime object to an UTC-based 9-tuple.

The reverse of ``struct_to_datetime``.

        def datetime_to_struct(datetime):
    """Convert a datetime object to an UTC-based 9-tuple.

    The reverse of ``struct_to_datetime``.
    """
    if not datetime:
        return datetime
    return datetime.utctimetuple()
        


src/f/e/feedplatform-HEAD/feedplatform/lib/addins/feeds/http.py   feedplatform(Download)
from feedplatform import addins
from feedplatform import db
from feedplatform.util import \
    datetime_to_struct, struct_to_datetime, to_unicode
 
    def on_before_parse(self, feed, parser_args):
        if self.etag:
            parser_args['etag'] = self._get_etag(feed)
        if self.modified:
            parser_args['modified'] = datetime_to_struct(self._get_modified(feed))