+ contrib/hbgt/tests
+ contrib/hbgt/tests/test.prg
+ contrib/hbmisc/tests/rtfclass.prg
- tests/rtfclass.prg
- tests/test10.prg
- tests/testgt.prg
* tests/ac_test.prg
* tests/alias.prg
* tests/begin.prg
* tests/boxtest.prg
* tests/cdow.prg
* tests/clasinh.prg
* tests/dates.prg
* tests/dates2.prg
* tests/dates3.prg
* tests/dates4.prg
* tests/ddate.prg
* tests/debugtst.prg
* tests/delimtst.prg
* tests/devtest.prg
* tests/disptest.prg
* tests/foreach.prg
* tests/gtstdtst.prg
* tests/ipclnt.prg
* tests/ipsvr.prg
* tests/langapi.prg
* tests/memtst.prg
* tests/memvar.prg
* tests/menutest.prg
* tests/mousetst.prg
* tests/multiarg.prg
* tests/newrdd.prg
* tests/nums.prg
* tests/objarr.prg
* tests/objasign.prg
* tests/objects.prg
* tests/omacro.prg
* tests/onidle.prg
* tests/os.prg
* tests/output.prg
* tests/overload.prg
* tests/parexpr.prg
* tests/passref.prg
* tests/procline.prg
* tests/procname.prg
* tests/recursiv.prg
* tests/returns.prg
* tests/round.prg
* tests/say.prg
* tests/sbartest.prg
* tests/scroll.prg
* tests/sdf_test.prg
* tests/seconds.prg
* tests/server.prg
* tests/set_num.prg
* tests/set_test.prg
* tests/setkeys.prg
* tests/sound.prg
* tests/speed.prg
* tests/statfun.prg
* tests/statics.prg
* tests/statics1.prg
* tests/statics2.prg
* tests/statinit.prg
* tests/strdelim.prg
* tests/stripem.prg
* tests/switch.prg
* tests/symbolt.prg
* tests/t1.prg
* tests/tb1.prg
* tests/testbrdb.prg
* tests/testbrw.prg
* tests/testcdx.prg
* tests/testcls.prg
* tests/testdbf.prg
* tests/testdecl.prg
* tests/testerro.prg
* tests/testfor.prg
* tests/testget.prg
* tests/testhrb.prg
* tests/testhtml.prg
* tests/testidle.prg
* tests/testmem.prg
* tests/testpers.prg
* tests/testtok.prg
* tests/testwarn.prg
* tests/tstalias.prg
* tests/tstasort.prg
* tests/tstblock.prg
* tests/tstdbi.prg
* tests/tstmacro.prg
* tests/varparam.prg
* tests/wvt_fs.prg
* cleaning up tests
92 lines
2.4 KiB
Plaintext
92 lines
2.4 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
// Testing Harbour dates management.
|
|
|
|
#include "set.ch"
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL dDate, dDate2, cMask, cDate
|
|
|
|
OutStd( hb_eol(), "Testing Harbour dates management on", Date() )
|
|
|
|
TestCentury()
|
|
|
|
OutStd( hb_eol(), "" )
|
|
OutStd( hb_eol(), "dDate := CToD( '02/04/1999' ) =>", dDate := CToD( "02/04/1999" ) )
|
|
|
|
OutStd( hb_eol(), "ValType( dDate ) =", ValType( dDate ) )
|
|
|
|
OutStd( hb_eol(), "Day( dDate ) =", Day( dDate ) )
|
|
OutStd( hb_eol(), "Month( dDate ) =", Month( dDate ) )
|
|
OutStd( hb_eol(), "Year( dDate ) =", Year( dDate ), hb_eol() )
|
|
|
|
OutStd( hb_eol(), "dDate + 5 =", dDate2 := dDate + 5 )
|
|
OutStd( hb_eol(), "dDate - 5 =", dDate - 5, hb_eol() )
|
|
|
|
OutStd( hb_eol(), "dDate2 - dDate =", dDate2 - dDate )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
OutStd( hb_eol(), dDate, DToS ( dDate ) )
|
|
|
|
OutStd( hb_eol(), "19990429", SToD ( "19990429" ) )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
SET ( _SET_EPOCH, 1950 )
|
|
cMask := "dd/mm/yyyy"
|
|
cDate := "02/04/49"
|
|
SET ( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD ( cDate )
|
|
OutStd( hb_eol(), cDate, cMask, dDate, DToS ( dDate ), DToC ( dDate ) )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
cMask := "mm/dd/yyyy"
|
|
SET ( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD ( cDate )
|
|
OutStd( hb_eol(), cDate, cMask, dDate, DToS ( dDate ), DToC ( dDate ) )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
cMask := "yyyy/mm/dd"
|
|
SET ( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD ( cDate )
|
|
OutStd( hb_eol(), cDate, cMask, dDate, DToS ( dDate ), DToC ( dDate ) )
|
|
OutStd( hb_eol(), "" )
|
|
OutStd( hb_eol(), "49/02/04", cMask, CToD ( "49/02/04" ) )
|
|
|
|
TestCentury( hb_eol() )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
cMask := "yyyy/dd/mm"
|
|
SET ( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD ( cDate )
|
|
OutStd( hb_eol(), cDate, cMask, dDate, DToS ( dDate ), DToC ( dDate ) )
|
|
OutStd( hb_eol(), "" )
|
|
OutStd( hb_eol(), "49/02/04", cMask, CToD ( "49/02/04" ) )
|
|
|
|
OutStd( hb_eol(), "" )
|
|
cMask := "ddd/mmm/yy"
|
|
SET ( _SET_DATEFORMAT, cMask )
|
|
dDate := CToD ( cDate )
|
|
OutStd( hb_eol(), cDate, cMask, dDate, DToS ( dDate ), DToC ( dDate ) )
|
|
|
|
RETURN
|
|
|
|
PROCEDURE TestCentury()
|
|
|
|
OutStd( hb_eol(), "" )
|
|
OutStd( hb_eol(), __SetCentury () )
|
|
__SetCentury ( "ON" )
|
|
OutStd ( __SetCentury () )
|
|
__SetCentury ( "OFF" )
|
|
OutStd ( __SetCentury () )
|
|
__SetCentury ( "GIBBERISH" )
|
|
OutStd ( __SetCentury () )
|
|
__SetCentury ( .T. )
|
|
OutStd ( __SetCentury () )
|
|
__SetCentury ( 5 )
|
|
OutStd ( __SetCentury () )
|
|
|
|
RETURN
|