Name

DateTime, Date, Timestamp

Synopsis

DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)

Creates and returns a DateTime instance representing the given absolute time. Date and Timestamp are synonyms of DateTime. day can be less than 0 to denote days counted from the end of the month: -1 is the last day of the month, -2 the next to last day, and so on. For example:

print mx.DateTime.DateTime(2002,12,-1)    
# prints: 2002-12-31 00:00:00.00

second is a floating-point value and can include an arbitrary fraction of a second.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.