Module Contents



class*, creationMagic: bool = False, date: bool = True, localize: bool = None, naive: bool = False, time: bool = True, updateMagic: bool = False, **kwargs)

Bases: viur.core.bones.base.BaseBone

type = 'date'
singleValueFromClient(value: str, skel: viur.core.skeleton.SkeletonInstance, name: str, origData)

Reads a value from the client. If this value is valid for this bone, store this value and return None. Otherwise our previous value is left unchanged and an error-message is returned.

Value is assumed to be in local time zone only if both and self.time are set to True and self.localize is True.

Value is valid if, when converted into String, it complies following formats:

  • is digit (may include one ‘-’) and valid POSIX timestamp: converted from timestamp; assumes UTC timezone

  • is digit (may include one ‘-’) and NOT valid POSIX timestamp and not date and time: interpreted as seconds after epoch

  • ‘now’: current time

  • ‘nowX’, where X converted into String is added as seconds to current time

  • ‘%H:%M:%S’ if not date and time

  • ‘%M:%S’ if not date and time

  • ‘%S’ if not date and time

  • ‘%Y-%m-%d %H:%M:%S’ (ISO date format)

  • ‘%Y-%m-%d %H:%M’ (ISO date format)

  • ‘%Y-%m-%d’ (ISO date format)

  • ‘%m/%d/%Y %H:%M:%S’ (US date-format)

  • ‘%m/%d/%Y %H:%M’ (US date-format)

  • ‘%m/%d/%Y’ (US date-format)

  • ‘%d.%m.%Y %H:%M:%S’ (EU date-format)

  • ‘%d.%m.%Y %H:%M’ (EU date-format)

  • ‘%d.%m.%Y’ (EU date-format)

The resulting year must be >= 1900.

  • name – Our name in the skeleton

  • valueUser-supplied request-data, has to be of valid format


tuple[datetime or None, [Errors] or None]


Ensure that year is >= 1900 Otherwise strftime will break later on.


Guess the timezone the user is supposed to be in. If not both date and time are set and the localize flag is set, then UTC is used. If it cant be guessed, a safe default (UTC) is used

singleValueSerialize(value, skel: SkeletonInstance, name: str, parentIndexed: bool)
buildDBFilter(name: str, skel: viur.core.skeleton.SkeletonInstance, dbFilter: viur.core.db.Query, rawFilter: Dict, prefix: str | None = None) viur.core.db.Query
performMagic(valuesCache, name, isAdd)
structure() dict