DateTime#
- class swordfish._swordfishcpp.DateTime(data: int)#
- class swordfish._swordfishcpp.DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int)
- class swordfish._swordfishcpp.DateTime
Represents a Swordfish DateTime object, initialized in one of three ways: with no arguments, with a Python int value, or with separate ints for year, month, day, hour, minute, and second.
- 参数:
data (int, optional) -- A Python int used to initialize the DateTime object (e.g., a timestamp).
year (int, optional) -- The year component of the DateTime object.
month (int, optional) -- The month component of the DateTime object.
day (int, optional) -- The day component of the DateTime object.
hour (int, optional) -- The hour component of the DateTime object.
minute (int, optional) -- The minute component of the DateTime object.
second (int, optional) -- The second component of the DateTime object.
示例
>>> import swordfish as sf >>> sf.data.DateTime() DateTime(null) >>> sf.data.DateTime(20) DateTime(1970.01.01T00:00:20) >>> sf.data.DateTime(2025,1,2,12,0,45) DateTime(2025.01.02T12:00:45)