embedded/mx/DateTime/__init__.py
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 16 Feb 2009 12:33:14 +0100
branchtls-sprint
changeset 624 258e5692ae06
parent 0 b97547f5f1fa
permissions -rw-r--r--
provide a new RichString attribute type The follwing declaration: class Card(EntityType): content = RichString(fulltextindexed=True, default_format='text/rest') is equivalent to : class Card(EntityType): content_format = String(meta=True, internationalizable=True, default='text/rest', constraints=[format_constraint]) content = String(fulltextindexed=True)

""" mxDateTime - Date and time handling routines and types

    Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2007, eGenix.com Software GmbH; mailto:info@egenix.com
    See the documentation for further information on copyrights,
    or contact the author. All Rights Reserved.
"""
from DateTime import *
from DateTime import __version__

## mock strptime implementation
from datetime import datetime

def strptime(datestr, formatstr, datetime=datetime):
    """mocked strptime implementation"""
    date = datetime.strptime(datestr, formatstr)
    return DateTime(date.year, date.month, date.day,
                    date.hour, date.minute, date.second)

# don't expose datetime directly
del datetime