'Constructor
@param format: strptime/strftime format template string, for
directives refer to your strptime implementation
@param error_message: error message for invalid date/times
@param offset_error: error message for invalid UTC offset
@param utc_offset: offset to UTC in hours, defaults to the
current session\'s UTC offset
@param calendar: calendar to use for string evaluation, defaults
to current.calendar
@param minimum: the minimum acceptable date/time
@param maximum: the maximum acceptable date/time'

def __init__(self, format=None, error_message=None, offset_error=None, utc_offset=None, calendar=None, minimum=None, maximum=None):

    if (format is None):
        self.format = str(current.deployment_settings.get_L10n_datetime_format())
    else:
        self.format = str(format)
    if isinstance(calendar, basestring):
        from s3datetime import S3Calendar
        calendar = S3Calendar(calendar)
    elif (calendar == None):
        calendar = current.calendar
    self.calendar = calendar
    self.utc_offset = utc_offset
    self.minimum = minimum
    self.maximum = maximum
    T = current.T
    if (error_message is None):
        if ((minimum is None) and (maximum is None)):
            error_message = T('Date/Time    is    required!')
        elif (minimum is None):
            error_message = T('Date/Time    must    be    %(max)s    or    earlier!')
        elif (maximum is None):
            error_message = T('Date/Time    must    be    %(min)s    or    later!')
        else:
            error_message = T('Date/Time    must    be    between    %(min)s    and    %(max)s!')
    if (offset_error is None):
        offset_error = T('Invalid    UTC    offset!')
    mindt = (self.formatter(minimum) if minimum else '')
    maxdt = (self.formatter(maximum) if maximum else '')
    self.error_message = (error_message % {'min': mindt, 'max': maxdt})
    self.offset_error = offset_error
