Solved

d1 to d3 TDateTime incompatability

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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