PyTime Object

A Python object, representing an instant in time.

Comments

A PyTime object is used primarily when exchanging date/time information with COM objects or other win32 functions.
Using int(timeObject) will return an integer compatible with the standard Python time module.

Example

First import the time module

import time

To return a simple string

time.ctime(int(timeObject))

To return a string formatted as the long date in control panel

time.strftime("%#c",

 time.localtime(int(timeObject)))

See Also

pywintypes::Time

Methods

Format
Formats the time value 

__int__
Used when an integer representation of the time object is required. 

__float__
Used when a floating point representation of the time object is required. 

__cmp__
Used when time objects are compared. tp_compare 

__repr__
Used for repr(ob) tp_repr 

__hash__
Used when the hash value of an time object is required tp_hash 

__str__
Used for str(ob) tp_str 

Properties

int year

int month

int weekday

int day

int hour

int minute

int second

int msec