Files
harbour-core/harbour/tests/dates3.prg
Viktor Szakats a31023ec0c 2012-11-28 01:06 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbmysql/tmysql.prg
  * contrib/hbnf/doc/en/restsets.txt
  * contrib/hbnf/doc/en/savesets.txt
  * contrib/hbnf/pvid.prg
  * contrib/hbnf/restsets.prg
  * contrib/hbnf/savesets.prg
  * contrib/rddads/tests/testmg.prg
  * contrib/xhb/traceprg.prg
  * contrib/xhb/ttable.prg
  * contrib/xhb/xhberr.prg
  * ChangeLog.txt
  * extras/gtwvw/tests/ebtest7.prg
  * src/debug/debugger.prg
  * tests/dates.prg
  * tests/dates2.prg
  * tests/dates3.prg
  * tests/inherit.prg
  * tests/output.prg
  * tests/readhrb.prg
  * tests/set_num.prg
  * tests/set_test.prg
  * tests/stripem.prg
  * tests/tstcolor.prg
  * website/samples/dates3.prg.html
    % do not #include "set.ch" (it's automatically 
      included via "std.ch")
2012-11-28 00:09:22 +00:00

52 lines
732 B
Plaintext

/*
* $Id$
*/
// Testing Harbour dates management.
PROCEDURE Main()
LOCAL dDate, i
Set( _SET_DATEFORMAT, "dd/mm/yyyy" )
dDate := hb_SToD( "19990525" )
? dDate, DoW( dDate )
? LastMonday( dDate )
dDate += 3
? dDate, DoW( dDate )
dDate += 4
? dDate, DoW( dDate )
Set( _SET_DATEFORMAT, "mm/dd/yyyy" )
dDate := hb_SToD( "19990525" )
? dDate, DoW( dDate )
? LastMonday( dDate )
dDate += 3
? dDate, DoW( dDate )
dDate += 4
? dDate, DoW( dDate )
?
dDate := Date ()
FOR i := 1 TO 7
? dDate, DoW( dDate )
dDate++
NEXT
? CToD( "" ), DoW( CToD( "" ) )
RETURN
// Like NG's sample
FUNCTION LastMonday( dDate )
RETURN dDate - DoW( dDate ) + 2