Usage of PyDateTime_FromTimestamp

A

Andreas

Hi,

I'm working on a c-extension of python and want to create an instance of
python datetime object with a unix timestamp in c.

On the documentation site ( http://docs.python.org/c-api/datetime.html )
I found the function PyDateTime_FromTimestamp() which returns a new
reference based on an input parameter.

The description is as follows: Create and return a new datetime.datetime
object given an argument tuple suitable for passing to
datetime.datetime.fromtimestamp().

I tried out to call the function with a PyFloat_Object but the function
always returns NULL (even if I simply put in 0).

Does somebody have an example how I have to call the function or can
give a hint what kind of parameter tuple is required to get it work?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,815
Messages
2,569,702
Members
45,493
Latest member
RosalieBag

Latest Threads

Top