"M.-A. Lemburg" wrote: > > In order to make mxDateTime subtypes of this new type we'd need to > make sure that the datetime type uses a true struct subset of what > I have in DateTime objects now: > > typedef struct { > PyObject_HEAD > > /* Representation used to do calculations */ > long absdate; /* number of days since 31.12. in the year 1 BC > calculated in the Gregorian calendar. */ > double abstime; /* seconds since 0:00:00.00 (midnight) > on the day pointed to by absdate */ > > ...lots of broken down values needed to assure roundtrip safety... > > } > > Depending on the size of PyObject_HEAD, this should meet Jim > Fultons requirements (the base type would of course not implement > the "..." part :-). I forgot to mention that there is another object type in mxDateTime too: DateTimeDelta. That's the type needed to represent the time difference between two DateTime instances, or what people usually call "time" :-) It has the following type "signature": typedef struct { PyObject_HEAD double seconds; /* number of delta seconds */ ...some broken down values needed to assure roundtrip safety... } -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4