Solved

d1 to d3 TDateTime incompatability

Posted on 1998-04-10
3
303 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

23 Experts available now in Live!

Get 1:1 Help Now