Solved

d1 to d3 TDateTime incompatability

Posted on 1998-04-10
3
301 Views
Last Modified: 2010-04-06
Various information I have found says that in order to convert a d1 date to a d3 date I need to subtract 693594.0. However, when I look at a databse reated with d1 it appears fine with d3. If I need to convert the datefields when should I do this?

Thanks, Tom.
0
Comment
Question by:tomcorcoran
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
pjdb earned 30 total points
ID: 1361387
If your database is conventional (say dBase, Paradox, Access or so) it's normal since the driver of the database convert the date from your code (Delphi format) to the standard format of the database. I think you can share such database without anay trouble between Delphi versions.
However, you can have troubles if you want to compare in you code a date to a reference date (for validation for example) and you just recompile the code. In this case you have to correct the reference values by 693594.
Except this kind of case, i don't see why there would be trouble with the new format.

JDB
0
 

Author Comment

by:tomcorcoran
ID: 1361388
JDB,

Could you elaborate on what you mean by compariong to a reference date - thanks,

Tom.
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1361389
For example you may want to verify that the date the user have put is after a reference date to ensure that there is no mistake. for example :
if userdate<358998 then {<-this line must be different from version to version}
{error message}
else
{ok}
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now