FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour strange error
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
strange error
Posted: Mon Feb 25, 2019 12:56 PM
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


WHY ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: strange error
Posted: Mon Feb 25, 2019 02:40 PM

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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: strange error
Posted: Mon Feb 25, 2019 03:14 PM

ja ja ja sorry my mistake,,,,

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion