* contrib/gtwvg/tests/_wvtcls.prg
* contrib/gtwvg/tests/demowvg.prg
* contrib/hbct/doc/en/dattime3.txt
* contrib/hbct/tests/datetime.prg
* contrib/hbnf/doc/en/acctadj.txt
* contrib/hbnf/doc/en/acctmnth.txt
* contrib/hbnf/doc/en/acctqtr.txt
* contrib/hbnf/doc/en/acctweek.txt
* contrib/hbnf/doc/en/acctyear.txt
* contrib/hbnf/doc/en/dayofyr.txt
* contrib/hbnf/doc/en/daytobow.txt
* contrib/hbnf/doc/en/elapsed.txt
* contrib/hbnf/doc/en/firstday.txt
* contrib/hbnf/doc/en/lastday.txt
* contrib/hbnf/doc/en/madd.txt
* contrib/hbnf/doc/en/month.txt
* contrib/hbnf/doc/en/qtr.txt
* contrib/hbnf/doc/en/savearr.txt
* contrib/hbnf/doc/en/setdate.txt
* contrib/hbnf/doc/en/wda.txt
* contrib/hbnf/doc/en/week.txt
* contrib/hbnf/doc/en/workdays.txt
* contrib/hbnf/doc/en/woy.txt
* contrib/hbnf/doc/en/year.txt
* contrib/hbnf/tests/elapsed.prg
* contrib/hbnf/tests/savearr.prg
* contrib/hbnf/tests/setdate.prg
* contrib/hbnf/tests/wda.prg
* contrib/hbnf/tests/workdays.prg
* contrib/hbnf/tests/woy.prg
* contrib/hbpgsql/tests/dbf2pg.prg
* contrib/hbsqlit3/hdbcsqlt.prg
* contrib/rddsql/tests/arrayrdd.prg
* doc/en/datetime.txt
* doc/en/math.txt
* doc/en/string.txt
* doc/hdr_tpl.txt
* extras/gtwvw/tests/ebtest7.prg
* extras/gtwvw/tests/wvwtest9.prg
* extras/guestbk/inifiles.prg
* extras/hbvpdf/core.prg
* extras/httpsrv/cgifunc.prg
* tests/array16.prg
* tests/bldtest/bldtest.c
* tests/byref.prg
* tests/dates.prg
* tests/gfx.prg
* tests/inifiles.prg
* tests/initexit.prg
* tests/longdev.prg
* tests/parseini.ini
* tests/parseini.prg
* tests/usrrdd/exarr.prg
* website/samples/byref.prg.html
* website/samples/initexit.prg.html
* website/samples/longdev.prg.html
* website/samples/mousetst.prg.html
* website/samples/parseini.ini.html
* website/samples/parseini.prg.html
* various cleanups
94 lines
1.8 KiB
Plaintext
94 lines
1.8 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
// Testing Harbour dates management.
|
|
|
|
#include "set.ch"
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL dDate, dDate2, cMask, cDate
|
|
|
|
? "Testing Harbour dates management on", Date()
|
|
|
|
TestCentury()
|
|
|
|
?
|
|
? "dDate := CToD( '02/04/1999' ) =>", dDate := CToD( "02/04/1999" )
|
|
|
|
? "ValType( dDate ) =", ValType( dDate )
|
|
|
|
? "Day( dDate ) =", Day( dDate )
|
|
? "Month( dDate ) =", Month( dDate )
|
|
? "Year( dDate ) =", Year( dDate )
|
|
?
|
|
|
|
? "dDate + 5 =", dDate2 := dDate + 5
|
|
? "dDate - 5 =", dDate - 5
|
|
?
|
|
|
|
? "dDate2 - dDate =", dDate2 - dDate
|
|
|
|
?
|
|
? dDate, DToS( dDate )
|
|
|
|
? "19990429", hb_SToD( "19990429" )
|
|
|
|
?
|
|
Set( _SET_EPOCH, 1950 )
|
|
cMask := "dd/mm/yyyy"
|
|
cDate := "02/04/49"
|
|
Set( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD( cDate )
|
|
? cDate, cMask, dDate, DToS( dDate ), DToC( dDate )
|
|
|
|
?
|
|
cMask := "mm/dd/yyyy"
|
|
Set( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD( cDate )
|
|
? cDate, cMask, dDate, DToS( dDate ), DToC( dDate )
|
|
|
|
?
|
|
cMask := "yyyy/mm/dd"
|
|
Set( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD( cDate )
|
|
? cDate, cMask, dDate, DToS( dDate ), DToC( dDate )
|
|
?
|
|
? "49/02/04", cMask, CToD( "49/02/04" )
|
|
|
|
TestCentury()
|
|
|
|
?
|
|
cMask := "yyyy/dd/mm"
|
|
Set( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD( cDate )
|
|
? cDate, cMask, dDate, DToS( dDate ), DToC( dDate )
|
|
?
|
|
? "49/02/04", cMask, CToD( "49/02/04" )
|
|
|
|
?
|
|
cMask := "ddd/mmm/yy"
|
|
Set( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD( cDate )
|
|
? cDate, cMask, dDate, DToS( dDate ), DToC( dDate )
|
|
|
|
RETURN
|
|
|
|
PROCEDURE TestCentury()
|
|
|
|
?
|
|
? __SetCentury()
|
|
__SetCentury( "ON" )
|
|
?? __SetCentury()
|
|
__SetCentury( "OFF" )
|
|
?? __SetCentury()
|
|
__SetCentury( "GIBBERISH" )
|
|
?? __SetCentury()
|
|
__SetCentury( .T. )
|
|
?? __SetCentury()
|
|
__SetCentury( 5 )
|
|
?? __SetCentury()
|
|
|
|
RETURN
|