PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Data and time Windev vs Clarion
Data and time Windev vs Clarion
Débuté par J. Flietstra, 16 mar. 2004 12:35 - 9 réponses
Posté le 16 mars 2004 - 12:35
I read the thread about the storage of the date and time in the database from Jeroen.
How does Windev store the Date/Time in a database field??
As far i can see as a string..
This is really tricky because the format.
In Clarion the date and the time are stored as a long/int (Ju date from 1801)
This long is displayed with a picture.
In this case it is possible to calculate directly on the database fields.
In this case we can display it in any format we want.
I have test the Windev format, and see on different format's different value's in the database:
15-03-2004 result in the database as 00/00/0020
15/03/2004 result in the database as 00/00/2004
And how about the time fields. Where are the seconds store in the database????
I see only hours and minutes... not any second!!
Please explain me the right way!
Kind regards
Jonathan Flietstra
Posté le 16 mars 2004 - 13:25
I read the thread about the storage of the date and time in the database from Jeroen.
How does Windev store the Date/Time in a database field??
As far i can see as a string..

Hello Jonathan,
use edDateCtrl..value = IntegerToDate(Your_Int_Holding_A_Clarion_Date + 362)
HTH
Raimund

http://www.invitec..com
Posté le 16 mars 2004 - 14:03
I read the thread about the storage of the date and time in the database from Jeroen.
How does Windev store the Date/Time in a database field??
As far i can see as a string..
Hello Jonathan,

use edDateCtrl..value = IntegerToDate(Your_Int_Holding_A_Clarion_Date + 362)

Hmmm... In this case i have to assign this everytime i want to display a date!
on my screens, on my reports etc.
Does Windev really store a data as a string in the database???
Posté le 16 mars 2004 - 14:26
G'day All
I have been tracking these threads with amazement.
I am not trying to offend anyone but.....
The dates and times in Windev are simple and easy to use. I think you are all confusing each other with misinterpretation of questions and answers.
PLEASE read the help and check out the Windev guide. There are at least 20 examples of using dates and times in the guide.
When you place a date field on a form there is an inbuilt display mask and return value - no programming required!
The only anomoly is that the time field does not hold seconds(at least not in 5.5) so if that is what you need then just use an 8chr string field to hold time as hhmmsscc. You can then treat this as a normal time field.
Regards
Al
Posté le 16 mars 2004 - 14:56
G'day All
I have been tracking these threads with amazement.
I am not trying to offend anyone but.....

Al,

it seems to me that Jonathan tries to show/display dates - stored somewhere in Clarion - with WinDev
Clear, or am I wrong?

http://www.invitec.com
Posté le 16 mars 2004 - 15:27
My only question was..
How does Windev store the date/time field in the database..
As far i can see as a formatted string (15/03/2004)..
Last monday we do some test en see that the date is a string in the database
and with strings it is difficult to calculate
We also see that a time value is stored without the seconds. We are wondering why Windev do that??
A clarion date is a number of days elapsed since december 28 1800. So this is a number in the database and we can calculate with it.
A Clarion time the number of hundreds of a second that have elapsed since midnight. It is possible to calculate with this value.
In Windev we see that if we change the imput format the value in the database is different... here is the problem.
in Windev we have first convert the date/time field before we can calculate with it.

G'day All
I have been tracking these threads with amazement.
I am not trying to offend anyone but.....
The dates and times in Windev are simple and easy to use. I think you are all confusing each other with misinterpretation of questions and answers.
PLEASE read the help and check out the Windev guide. There are at least 20 examples of using dates and times in the guide.
When you place a date field on a form there is an inbuilt display mask and return value - no programming required!
The only anomoly is that the time field does not hold seconds(at least not in 5.5) so if that is what you need then just use an 8chr string field to hold time as hhmmsscc. You can then treat this as a normal time field.
Regards
Al
Posté le 16 mars 2004 - 17:04
>In Windev we see that if we change the imput format the value in the database is different... here is the problem.
No, you should always distinguish between input mask and return value. Change the input mask or use "System Date" as input mask, but do not change the "Returned value".
in Windev we have first convert the date/time field before we can calculate with it.

No, you have DateDifference, DateTimeDifference a.s.o. for calculation. Sure you can also use DateToInteger/...


http://www.invitec.com
Posté le 16 mars 2004 - 21:41
G'day Raimund
>it seems to me that Jonathan tries to show/display dates - stored somewhere in Clarion - with WinDev
That is the fascinating thing about all of us coming together in this forum. My interpretation was that Jonathon was only commenting on the differences between the way Clarion handled dates to the Windev does.
Dates and times are stored in tables as strings in "yyyymmdd" and "hhmm" formats but to me the discussion about how Windev stores dates and times is irrelevant, because we can't alter it. All we can do is make best use of the commands and process they supply to manipulate the dates although I must admit that I faced the same issues and despaired of making sense of the Windev date/time issue when I moved from Foxpro, which also stored dates as Ju numbers, but once I accepted the "Windev way" I have had no troubles and now I am so used to it that it is simple.

Regards
Al
Posté le 17 mars 2004 - 00:25
Hi Al,
The dates and times in Windev are simple and easy to use. I think you are all
confusing each other with misinterpretation of questions and answers.

[...]
Time (& season) is different between here and where you are but i agree
completely!
Peter
Posté le 17 mars 2004 - 00:43
Hi,
How does Windev store the date/time field in the database..
As far i can see as a formatted string (15/03/2004)..

It is a string but not formatted, just 'yyyymmdd'. (The WDMap tool
shows the formatted string!)

Last monday we do some test en see that the date is a string in the database
and with strings it is difficult to calculate

No, with the date/time functions available it is very easy.
We also see that a time value is stored without the seconds. We are wondering
why Windev do that??

Because they use a 4 digit string for it ...
A clarion date is a number of days elapsed since december 28 1800. So this is a
number in the database and we can calculate with it.
A Clarion time the number of hundreds of a second that have elapsed since
midnight. It is possible to calculate with this value.
In Windev we see that if we change the imput format the value in the database
is different... here is the problem.

No, the input format doesnt change the value in the database.
in Windev we have first convert the date/time field before we can calculate
with it.

[...]
Greetings,
Peter