c4d.DateTimeData

Date time data type (DATETIME_DATA) for the DateTimeControl GUI.

This type is called by value.

Inheritance

Members

DateTimeData.__init__([v])
Parameters: v (DateTimeData) – Copy constructor.
Return type: DateTimeData
Returns: The new datetime data.
DateTimeData.GetDateTime()

Return the time.

Return type: time.struct_time
Returns: The time.
DateTimeData.SetDateTime(d[, bSetData=True][, bSetTime=True])

Set the time.

Parameters:
  • d (time.struct_time) – The new time.
  • d – If this is False the date part of d is disregarded.
  • d – If this is False the time part of d is disregarded.

Here is a sample code that shows how to parse a string into a DateTimeData object:

import datetime
from datetime import datetime
#parse the string
td=datetime.strptime('16.07.2011 03:37:12',"%d.%m.%Y %H:%M:%S")
dtd=DateTimeData()
#set the datetime.datetime object to the DateTimeData object
dtd.SetDateTime(td)

Table Of Contents