strange error

strange error

Postby Silvio.Falconi » 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
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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: strange error

Postby nageswaragunupudi » Mon Feb 25, 2019 2: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: strange error

Postby Silvio.Falconi » Mon Feb 25, 2019 3:14 pm

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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], karinha, SantaCroya and 63 guests