Python Component API: class DateTimeValue

The following methods are available for Python class DateTimeValue.

This page discusses:

Description

This class is a wrapper around rawpilot.DateTimeValue. It is part of the pilotpython module, which is available in the Python (on Server) component.

Method resolution order

class DateTimeValue(Value)

DateTimeValue.__init__(val)
Description Constructor.
Input parameters param val: Value to wrap

type val: rawpilot.DateTimeValue

Return value None
DateTimeValue.get()
Description Copies the represented date/time value into a datetime.* object.
Input parameters None
Return value returns: Date/time

rtype: datetime.time, or datetime.date, or datetime.datetime

DateTimeValue.getDay()
Description Gets the day of the month.
Input parameters None
Return value returns: Day (1..31)

rtype: int

DateTimeValue.getHour()
Description Gets the hour of the day.
Input parameters None
Return value returns: Hour (0..23)

rtype: int

DateTimeValue.getMilliseconds()
Description Gets the millisecond.
Input parameters None
Return value returns: Millisecond (0..999)

rtype: int

DateTimeValue.getMinute()
Description Gets the minute.
Input parameters None
Return value returns: Minute (0..59)

rtype: int

DateTimeValue.getMonth()
Description Gets the month.
Input parameters None
Return value returns: Month (1..12)

rtype: int

DateTimeValue.getSecond()
Description Gets the second.
Input parameters None
Return value returns: Second (0..59)

rtype: int

DateTimeValue.getTimeZone()
Description Gets the time zone.
Input parameters None
Return value returns: Time zone

rtype: str

DateTimeValue.getYear()
Description Returns the year.
Input parameters None
Return value returns: year

rtype: int

DateTimeValue.isFieldDefined(field)
Description Checks if the requested field has a defined value; for example, the date portion would be invalid for a time.
Input parameters param field: Field to check

type field: {YEAR, MONTH, DAY, HOUR, SECOND, MILLISECOND}

Return value returns: True if the field is defined

rtype: bool

DateTimeValue.set(dtObj)
Description sets the wrapped rawpilot's value to the given Python object's data.
Input parameters param dtObj: Date/time data to set

type dtObj: datetime.date, or datetime.time, or datetime.datetime

Return value None
DateTimeValue.setDay(day)
Description Sets the day of the month.
Input parameters param day: Day to set (1..31)

type day: int

Return value None
DateTimeValue.setFieldUndefined(field)
Description Invalidate the given field.
Input parameters param field: Field to undefine

type field: {YEAR, MONTH, DAY, HOUR, SECOND, MILLISECOND}

Return value None
DateTimeValue.setHour(hour)
Description Sets the hour.
Input parameters param hour: Hour to set (0..23)

type month: int

Return value None
DateTimeValue.setMilliseconds(ms)
Description Sets the millisecond.
Input parameters param ms: Millisecond to set (0..999)

type month: int

Return value None
DateTimeValue.setMinute(minute)
Description Sets the minute.
Input parameters param minute: Minute to set (0..59)

type minute: int

Return value None
DateTimeValue.setMonth(month)
Description Sets the month.
Input parameters param month: Month to set (1..12)

type month: int

Return value None
DateTimeValue.setSecond(second)
Description Sets the second.
Input parameters param second: Second to set (0..59)

type second: int

Return value None
DateTimeValue.setTimeZone(tz, updateTime)
Description Sets the time zone
Input parameters param tz: Time zone to set

type tz: str

param updateTime: If True, the time is updated from the new time zone

type updateTime: bool

Return value None
DateTimeValue.setYear(year)
Description Sets the year.
Input parameters param year: Year to set

type year: int

Return value None

Methods inherited from Value

DateTimeValue.CreateValue(classTag)
Description Creates a new pilotpython.Value instance of the type specified by classTag. The Value instance must be deleted using Value.deleteInstance() after use. The exception is the ValueArrayValue type, which takes ownershipof any values added to it. The ValueHolder class can be used to store the newly created value. When a ValueHolder moves out of scope, the value it contains is destroyed.
Input parameters param classTag: Tag specifying the class of value to create

type classTag: str

Return value None
DateTimeValue.GetValue(rawVal)
Description Takes a rawpilot.Value and returns it wrapped in its pilotpython.Value.
Input parameters rawVal
Return value None
DateTimeValue.cloneValue()
Description Creates a clone (deep copy) of the value.
Input parameters None
Return value returns: Deep copy of value

rtype: Value

DateTimeValue.deleteInstance()
Description Deletes an instance of a value. Any value created with cloneValue() or newInstanceXXX(), and not assigned to a property, must be deleted.
Input parameters None
Return value None
DateTimeValue.getBoolArray()
Description Returns a copy(!) of the entire data set of a BooleanArrayValue.
Input parameters None
Return value returns: All bools contained in value

rtype: list

DateTimeValue.getBoolean()
Description Returns the value's contents as a boolean value.
Input parameters None
Return value returns: Data as a boolean

rtype: bool

DateTimeValue.getByteArray()
Description Returns a read-only view of the binary data.
Input parameters None
Return value returns: Byte array data

rtype: memoryview

DateTimeValue.getClassTag()
Description Returns the value's type in Pipeline Pilot notation.
Input parameters None
Return value returns: A class tag

rtype: str

DateTimeValue.getFloat()
Description Returns the value's contents as a float.
Input parameters None
Return value returns: Value contents as float

rtype: float

DateTimeValue.getFloatArray()
Description Returns a copy(!) of the entire data set of a DoubleArrayValue.
Input parameters None
Return value returns: All floats contained in value

rtype: list

DateTimeValue.getIntArray()
Description Returns a copy(!) of the entire dataset of an IntegerArrayValue.
Input parameters None
Return value returns: All ints contained in value

rtype: list

DateTimeValue.getInteger()
Description Returns the value's contents as an int.
Input parameters None
Return value returns: Data as int

rtype: int

DateTimeValue.getIthBoolean(index)
Description For ArrayValues: returns the data at index as a boolean value. This operation is not supported by all ArrayValue types.
Input parameters param index: Index to use

type index: int

Return value returns: bool at given index

rtype: bool

DateTimeValue.getIthFloat(index)
Description For ArrayValues: returns the data at index as a float. This operation is not supported by all ArrayValue types.
Input parameters param index: Index to use

type index: int

Return value returns: Float at given index

rtype: float

DateTimeValue.getIthInteger(index)
Description For ArrayValues: returns the data at index as an int. This operation is not supported by all ArrayValue types.
Input parameters param index: Index to use

type index: int

Return value returns: int at given index

rtype: int

DateTimeValue.getIthString(index)
Description For ArrayValues: returns the data at index as a string. This operation is not supported by all ArrayValue types.
Input parameters param index: Index to use

type index: int

Return value returns: String at given index

rtype: str

DateTimeValue.getRawValue()
Description Returns the raw swigpython3 Value instance wrapped by this instance.
Input parameters None
Return value returns: Wrapped value

rtype: swigpython3.Value (or subclass). See getClassTag() for details.

DateTimeValue.getSize()
Description Returns the size of the value.
Input parameters None
Return value returns: Number of elements

rtype: int

DateTimeValue.getString()
Description Returns the value's contents as a string.
Input parameters None
Return value returns: Value contents as string

v

DateTimeValue.getStringArray()
Description Returns a copy(!) of the entire data set of a StringArrayValue.
Input parameters None
Return value returns: all strings contained in value

rtype: list

DateTimeValue.setBoolean(val)
Description Sets the value to the given boolean value
Input parameters param val: Value to set

type val: bool

Return value None
DateTimeValue.setFloat(val)
Description Sets the value's data to the given float value
Input parameters param val: Value to set

type val: float

Return value None
DateTimeValue.setInteger(val)
Description Sets the value's data to the given int value.
Input parameters param val: Value to set

type val: int

Return value None
DateTimeValue.setString(val)
Description Sets the value to the supplied string. The wrapped Value must support this operation.
Input parameters param val: string to set

type val: str

Return value None
DateTimeValue.toDictionary()
Description Returns a copy of a HashTableValue as a Python dict object.
Input parameters None
Return value returns: Hash table

rtype: dict

Data descriptors inherited from Value

DateTimeValue.__dict__
Description dictionary for instance variables (if defined)
DateTimeValue.__weakref__
Description list of weak references to the object (if defined)