

def str_date_to_couch(from_date):
    "\n    Converts date from form date widget generated format\n\n    e.g.:\n    date '2012-03-02' or whatever format specified in settings.py\n    to CouchDocument stored date. E.g.: '2012-03-02T00:00:00Z'\n    "
    converted_date = ''
    try:
        couch_date = datetime.datetime.strptime(from_date, settings.DATE_FORMAT)
        converted_date = str(couch_date.strftime(settings.DATE_COUCHDB_FORMAT))
    except ValueError:
        log.error(('adlibre.date_convertor time conversion error. String received: %s' % from_date))
        pass
    return converted_date

dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/libraries/adlibre/date_converter.py str_date_to_couch/original