strange error

Post Reply
User avatar
Silvio.Falconi
Posts: 7134
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

strange error

Post by Silvio.Falconi »

If I have this test

Function test()
Local dDatafine:=ctod("14/08/2019")
SET DATE FORMAT "dd/mm/yyyy"
SET DATE ITALIAN
SET CENTURY ON
SET EPOCH TO ( YEAR( DATE() ) - 50 )
? dDatafine
return nil


it return me this
Image

WHY ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: strange error

Post by nageswaragunupudi »

What is strange in it? You look at your own code carefully.

You have used CTOD() before setting DATE FORMAT. Till you set the date format is the default format "mm/dd/yy". 14 as month is invalid.

To avoid such mistakes it is a good idea to use STOD( "20190814" ). This does not depend on date format.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7134
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: strange error

Post by Silvio.Falconi »

ja ja ja sorry my mistake,,,,
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply