c4d.DateTimeData
¶
DateTime data type (
DATETIME_DATA
) for the
DateTimeControl
GUI.
This type is called by value.
c4d.
DateTimeData
¶
c4d.CustomDataType
DateTimeData.
__init__
(
[
v
]
)
¶
Parameters: | v ( c4d.DateTimeData ) – Copy constructor. |
---|---|
Return type: | c4d.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: |
|
---|
Here is a sample code that shows how to parse a string into a
DateTimeData
object:
import c4d from datetime import datetime # Parse the time string dt = datetime.strptime('16.07.2011 03:37:12',"%d.%m.%Y %H:%M:%S") dtd = c4d.DateTimeData() # Fills the Data object with the DateTime object dtd.SetDateTime(dt) t = dtd.GetDateTime() print t.day print t.month print t.year