By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,857 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

How to create datetime object from DbiDate (win32.odbc)?

P: n/a
Hi all

I am using odbc from win32 extensions to connect to MS SQL Server. I
use mx.DateTime to handle dates. When I select a datetime column from
the database, odbc returns something called a DbiDate object. I cannot
find out any information on this type, but mx can convert it to a
mx.DateTime object using DateTimeFrom(), which is really all that I
need.

I am looking into changing from mx.DateTime to using the builtin
datetime type, but I cannot figure out how to convert a DbiDate object
to a datetime object.

First prize would be to have a datetime constructor that takes a
DbiDate object as input, in the same way that mx does, but this does
not seem to exist.

Second prize would be to extract the year/month/day elements from the
DbiDate object, and construct the datetime object manually. However, if
I try dir(d), where d is a DbiDate object, I get an empty list, so I
cannot even see how to extract the elements.

Does anyone know if this is possible, and if so, how?

Many thanks

Frank Millman

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Frank Millman wrote:
Hi all

I am using odbc from win32 extensions to connect to MS SQL Server. I
use mx.DateTime to handle dates. When I select a datetime column from
the database, odbc returns something called a DbiDate object. I cannot
find out any information on this type, but mx can convert it to a
mx.DateTime object using DateTimeFrom(), which is really all that I
need.

I am looking into changing from mx.DateTime to using the builtin
datetime type, but I cannot figure out how to convert a DbiDate object
to a datetime object.

First prize would be to have a datetime constructor that takes a
DbiDate object as input, in the same way that mx does, but this does
not seem to exist.

Second prize would be to extract the year/month/day elements from the
DbiDate object, and construct the datetime object manually. However, if
I try dir(d), where d is a DbiDate object, I get an empty list, so I
cannot even see how to extract the elements.

Does anyone know if this is possible, and if so, how?

Many thanks

Frank Millman

I've always used

from mx.DateTime import DateTimeFromCOMDate
t=DateTimeFromCOMDate(dbidate)

Larry Bates
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.