CT_CToDoW()

  NAME :
     CToDoW()
  CATEGORY :
     CT3 date and time functions
  ONELINER :
     Convert name of day of the week to its ordinal number
  SYNTAX :
     CToDoW( <cDayName> ) -> <nOrdinal>
  ARGUMENT :
     <cDayName> : Name of day to convert to ordinal number
  RETURN :
     <nOrdinal> : Ordinal number of <cDayName>
  EXAMPLE :
 PROC MAIN()
    SETMODE( 25, 80 )
    CLS
    SET DATE GERM
    SET CENT ON
    ? "CTODOW('Sunday') :", CTODOW('Sunday') // 1
    *  Show several ways to get the day of
    *  the week for Wednesday:
    ? "CTODOW('WEDNESDAY') :", CTODOW('WEDNESDAY')      // 4
    ? "CTODOW('Wednesday') :", CTODOW('Wednesday')      // 4
    ? "CTODOW('Wed') :",CTODOW('Wed')                   //  4
    *  What number of the day of the week is Monday?
    ? "CTODOW( 'M' ) :", CTODOW( 'M' ) //  2
    ?
    WAIT "EOF CTODOW.prg"
 RETURN // MAIN
  COMPLIANCE :
     CToDoW() is compatible with CT3's CToDoW()
  PLATFORMS :
     All
  FILES :
     Library is hbct.
  SEE ALSO :
     NToCDoW()


CT_EoY()

  NAME :
     EoY()
  CATEGORY :
     CT3 date and time functions
  SYNTAX :
     EoY( [<dDate>] ) -> dDateEndOfYear
  ARGUMENT :
     [<dDate>] : Date to find last day of year, default is DATE()
  RETURNS :
     <dDateEndOfYear> : Last date Of Year of given date
  EXAMPLE :
 PROC MAIN()
    SETMODE( 25, 80 )
    CLS
    SET DATE GERM
    SET CENT ON
    ? "Today is :", DATE()
    ? "Last day of this year :", EoY()
    ? "Remaining days in the current year:", EoY() - DATE()
    ?
    WAIT "EOF EoY.prg"
 RETURN // MAIN
  COMPLIANCE :
     EoY() is compatible with CT3's EoY()
  PLATFORMS :
     All
  FILES :
     Library is hbct
  SEE ALSO :
     BoM(),EoM(),BoQ(),EoQ(),BoY()

CT_BoY()

  NAME :
     BoY()
  CATEGORY :
     CT3 date and time functions
  SYNTAX :
     BoY( [<dDate>] ) -> dDateBeginOfYear
  ARGUMENT :
     [<dDate>] : Date to find first day of year, default is DATE()
  RETURNS :
     <dDateBeginOfYear> : Beginning date Of year of given date
  EXAMPLE :
 PROC MAIN()
    SETMODE( 25, 80 )
    CLS
    SET DATE GERM
    SET CENT ON
    ? "Today is :", DATE()
    ? "Date of first day of this year :", BOY()
    ? "Days elapsed in the current year:", DATE() - BOY()
    ?
    WAIT "EOF BoY.prg"
 RETURN // MAIN
  COMPLIANCE :
     BoY() is compatible with CT3's BoY()
  PLATFORMS :
     All
  FILES :
     Library is hbct.
  SEE ALSO :
     BoM(),EoM(),BoQ(),EoQ(),EoY()


CT_EoQ()

  NAME
     EoQ()
  CATEGORY
     CT3 date and time functions
  SYNTAX
     EoQ( [<dDate>] ) -> dDateEndOfQ
  ARGUMENT:
     [<dDate>] : Date to find end of quarter, default is DATE()
  RETURNS:
     <dDateEndOfQuarter> : Date of end of quarter containing given date
  EXAMPLE :
     PROC MAIN()
        SETMODE( 25, 80 )
        CLS
        SET DATE GERM
        SET CENT ON
        ? "Today is :", DATE()
        ? "Last day of this quarter
        ? "Days remaininng in the cu
        ?
        WAIT "EOF EOQ.prg"
     RETURN // MAIN
  COMPLIANCE :
     EoQ() is compatible with CT3's
  PLATFORMS :
     All
  FILES :
     Library is hbct.
  SEE ALSO :
     BoM(),EoM(),BoQ(),BoY(),EoY()

CT_BoQ()

  NAME :
     BoQ()
  CATEGORY :
     CT3 date and time functions
  SYNTAX :
     BoQ( [<dDate>] ) -> <dDateBeginOfQuarter>
  ARGUMENT :
     [<dDate>] : Date to find Begin Of Quarter, default is DATE()
  RETURNS :
     <dDateBeginOfQuarter> : Date of beginning Of quarter containing given date
  EXAMPLE :
     PROC MAIN()
        SETMODE( 25, 80 )
        CLS
        SET DATE GERM
        SET CENT ON
        ? "Today is :", DATE()
        ? "Beginning day of this quarter :", BOQ()
        ? "Days elapsed in the current quarter :", DATE() - BOQ()
        ?
        WAIT "EOF BOQ.prg"
     RETURN // MAIN
  COMPLIANCE :
     BoQ() is compatible with CT3's BoQ()

  PLATFORMS :
     All
  FILES :
     Library is hbct.
  SEE ALSO :
     BoM(), EoM(), EoQ(), BoY(), EoY()

CT_EoM()

NAME :
   EoM()

CATEGORY :
   CT3 date and time functions

ONELINER :
   End Of Month

SYNTAX :
   EoM( [<dDate>] ) -> <dDateEndOfMon

ARGUMENT :
   [<dDate>] : Date to find last day
RETURNS :
   <dDateEndOfMonth> : Last date Of Month

EXAMPLES :
PROC MAIN()
   SETMODE( 25, 80 )
   CLS
   SET DATE GERM
   SET CENT ON
   ? "Today is :", DATE()
   ? "Last day of this month :", EOM()
   ? "Remaining days in the current month:", EOM() - DATE()
   ?
   WAIT "EOF EOM.prg"
    RETURN // MAIN

COMPLIANCE :
   EoM() is compatible with CT3's EoM
PLATFORMS :
   All 

FILES :
   Library is hbct.

SEE ALSO :
BoM(), BoQ(), EoQ(), BoY(), EoY()

CT_BoM()

  NAME
     BoM()
  CATEGORY
     CT3 date and time functions
  SYNTAX :
     BoM( [<dDate>] ) -> <dDateBeginOfMonth>
  ARGUMENT :
     [<dDate>] : Date to find first day of month, default is DATE()
  RETURNS :
    <dDateBeginOfMonth> : Beginning date Of Month of given date
  EXAMPLES
 PROC MAIN()
    SETMODE( 25, 80 )
    CLS
    SET DATE GERM
    SET CENT ON
    ? "Today is :", DATE()
    ? "Date of first day of this month :", BOM()
    ? "Days elapsed in the current month:", DATE() - BOM()
    ?
    WAIT "EOF BOM.prg"
 RETURN // MAIN
  COMPLIANCE   
     BoM() is compatible with CT3's BoM().
  PLATFORMS

     All
  FILES
     Library is hbct.
  SEE ALSO
     EoM(), BoQ(), EoQ(), BoY(), EoY()

CT_SetDate

  NAME
     SetDate()
  CATEGORY
     CT Date and Time Functions
  ONELINER
     Sets the system date
  SYNTAX
     SetDate( <dDate>, [<lMode>] ) --> lSet
  ARGUMENTS
     <dDate>  Designates which date to use to set the system date.
     <lMode>  Designates whether the date should also be set in the CMOS-
     RAM of an AT.  The default is do not write (.F.). Note that in Windows
     plataform this adjust is automatic, therefore this parameter is without
     efect.
  RETURNS
     SetDate() RETURNs .T. when the date is successfully set.
  DESCRIPTION
     When you use this FUNCTION to set the system date from within your
     application, all files acquire this date with each write procedure.
  EXAMPLES
     // Set the system date in each case; but the hardware clock only
     // on an AT:
     dNewDate := hb_SToD( "19910730" )
     IF IsAt()
        SetDate( dNewDate, .T. )
     ELSE
        SetDate( dNewDate )
     ENDIF
     Or, more compactly:
     SetDate( dNewDate, IsAt() )
  STATUS
     Ready
  COMPLIANCE
     This function is Clipper Tools compatible.
  PLATFORMS
     Windows, Linux
  FILES
     Library is hbct.
  SEEALSO
     SetTime()

CT_SetTime

  NAME
     SetTime()
  CATEGORY
     HBCT Date and Time Functions
  ONELINER
     Sets the system clock
  SYNTAX
     SetTime( <cTime>, [<lMode>] ) --> lSet
  ARGUMENTS
     <cTime>  Designates a character string that contains the time that
     is to become the system time.
     <lMode>  Designates whether the time should also be set in the
     CMOS-RAM of an AT.  The default is do not write to CMOS-RAM. Note that in
     Windows platform this adjust is automatic, therefore this parameter is
     without efect.
  RETURNS
     The FUNCTION RETURNs .T. when the time is set successfully.
  DESCRIPTION
     When you use this FUNCTION to convert the time into the system time from
     within your application, all files acquire this time with
     each write procedure.
  EXAMPLES
     // Set the system time in each case; but the hardware clock only
     // on an AT:
     cNewTime := "10:20:00"
     IF IsAt()
        SetTime( cNewTime, .T. )
     ELSE
        SetTime( cNewTime )
     ENDIF
     Or, more compactly:
     SetTime( cNewTime, IsAt() )
  STATUS
     Ready
  COMPLIANCE
     This function is Clipper Tools compatible.
  PLATFORMS
     Windows, Linux
  FILES
     Library is hbct.
  SEEALSO
     SetDate(), TimeValid()

CT_TimeValid

  NAME
     TimeValid()
  CATEGORY
     HBCT Date and Time Functions
  ONELINER
     Determines whether a specIFied time is valid
  SYNTAX
     TimeValid( <cTime> ) --> lValid
  ARGUMENTS
     <cTime>  Designates a character string that contains the time to
     test.
  RETURNS
     TimeValid() RETURNs .T. when <cTime> is a valid time; or .F. when
     <cTime> is an invalid time.
  DESCRIPTION
     With input that requires time manipulation, writing your own UDF to
     check time inputs was unavoidable up to now.  TimeValid() permits
     Complete checking of a time designation.  You can use this FUNCTION
     effectively with a VALID clause within a READ mask.
 Note
     Note the format for time designations.  There must always be
     two digits for hours, minutes, seconds, and hundredths; otherwise,
     the time it is regarded as invalid.  Valid examples are "12",
     "12:59", "12:59:59", and "12:59:59:99".  By contrast, invalid
     examples are "24", "12:60", or "12:1", and/or "12:".  IF you work
     with time strings that are not completely filled and that you need to
     check with TimeValid(), then they must be TRIMmed prior to the use of
     TimeValid() (see following Examples).
  EXAMPLES
       PROC MAIN()
          SETMODE( 25, 80 )
          CLS
          cBegin := TIME()
          cEnd  := SECTOTIME( SECONDS() + 60 )
          // Using the VALID clause with TRIM, all valid times are
          // accepted, even IF no seconds or minutes are specified:
          @ 5, 10 SAY "Please input time for beginning work:";
             GET cBegin VALID TimeValid( RTrim( cBegin ) )
          // Using a VALID clause without TRIM, hours and minutes must be
          // specified, so that TimeValid() can confirm a valid time:
          @ 7, 10 SAY "Please input time for beginning work:";
             GET cEnd VALID TimeValid( cEnd )
          READ
       RETURN // MAIN
  STATUS
     Ready
  COMPLIANCE
     This function is Clipper Tools compatible.
  PLATFORMS
     All
  FILES
     Library is hbct.
  SEEALSO
     SetTime()