freelanceprogrammers.org Forum Index » Delphi

TDateTime and variants


View user's profile Post To page top
oliverbock Posted: Thu May 18, 2006 6:45 am


Joined: 15 Sep 2005

Posts: 12
TDateTime and variants
In PythonEngine.pas:6152, using Delphi 7 and Python for Delphi 3.29, the
line

Date := EncodeDate( y, m, d ) + EncodeTime( h, mi, sec, msec );

should perhaps read

var
dt: TDateTime;

dt := EncodeDate( y, m, d ) + EncodeTime( h, mi, sec, msec );
Date := dt;

And similarly on line 6140.

Without this change, datetime.datetime Python objects are converted to
varDouble instead of varDate because of Delphi type "promotion".


Regards,

Oliver
Reply with quote
Send private message
View user's profile Post To page top
morgan_martinet Posted: Thu May 18, 2006 4:37 pm


Joined: 29 Apr 2005

Posts: 103
TDateTime and variants
I think I deleted your mail by mistake, sorry!
Anyway, you`re perfectly right and will fix it in the next release!
Thanks,

Morgan

> -----Original Message-----
> From: Oliver Bock [mailto:oliver@...]
> Sent: Wednesday, May 17, 2006 9:45 PM
> To: pythonfordelphi@yahoogroups.com
> Subject: TDateTime and variants
>
> In PythonEngine.pas:6152, using Delphi 7 and Python for Delphi 3.29, the
> line
>
> Date := EncodeDate( y, m, d ) + EncodeTime( h, mi, sec, msec );
>
> should perhaps read
>
> var
> dt: TDateTime;
>
> dt := EncodeDate( y, m, d ) + EncodeTime( h, mi, sec, msec );
> Date := dt;
>
> And similarly on line 6140.
>
> Without this change, datetime.datetime Python objects are converted to
> varDouble instead of varDate because of Delphi type "promotion".
>
>
> Regards,
>
> Oliver
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help