Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12446 > unrolled thread

Usage of PyDateTime_FromTimestamp

Started byAndreas <aww.dev@googlemail.com>
First post2011-08-30 22:42 +0200
Last post2011-08-30 22:42 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Usage of PyDateTime_FromTimestamp Andreas <aww.dev@googlemail.com> - 2011-08-30 22:42 +0200

#12446 — Usage of PyDateTime_FromTimestamp

FromAndreas <aww.dev@googlemail.com>
Date2011-08-30 22:42 +0200
SubjectUsage of PyDateTime_FromTimestamp
Message-ID<mailman.579.1314737106.27778.python-list@python.org>
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!

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web