EOY()

EOY()

Last date Of Year

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

       SET DATE ANSI
       ? EOY( hb_SToD( "20000101" ) ) // -> "2000.12.31"
       ? EOY( hb_SToD( "20010101" ) ) // -> "2001.12.31"
       *--------------------
       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

Source is datetime.prg, library is libct.

See also

BOM(), EOM(), BOQ(), EOQ(), BOY()

EoQ()

EoQ()

Date of end of quarter

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 EOQ().

Platforms

All

Files

Source is datetime.prg, library is libct.

See also

BOM(), EOM(), BOQ(), BOY(), EOY()

EOM()

EOM()

End Of Month

Syntax

       EOM( [<dDate>] ) -> <dDateEndOfMon

Argument

[<dDate>] Date to find last day

Returns

<dDateEndOfMonth> Last date Of Month

Examples

       SET DATE ANSI
       ? EOM( hb_SToD( "20000101" ) ) // -> "2000.01.31"
       ? EOM( hb_SToD( "20000201" ) ) // -> "2000.02.29"
       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
/*
Today is : 04.07.2013
Last day of this month : 31.07.2013
Remaining days in the current month: 27
EOF EOM.prg
*/

Compliance

EOM() is compatible with CT3’s EOM().

Platforms

All

Files

Source is datetime.prg, library is libct.

See also

BOM(), BOQ(), EOQ(), BOY(), EOY()

BoY()

BoY()

Date to find first day of year, default is DATE()

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()

BoQ()

BoQ()

Date of beginning Of quarter containing given date

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()

SP Date Functions

 DATECALC()     Adds/subtracts days,weeks,months,years to a date
 DTOW()         Converts date to words
 STOD()         Returns date from string in the form YYYYMMDD
 WOYEAR()       Calculates week of the year (# of 7 day periods)
 DTDIFF()       Returns difference between dates
 DAYSIN()       Calculates number of days in a month
 BOYEAR()       Determine beginning of year a date falls in
 BOM()          Calculates beginning of the month date
 DOYEAR()       Calculates day of the year from date
 SETCENT()      Determines if century is on/off
 WOMONTH()      Calculates week of the month (# of 7 day periods)
 BEGEND()       Determines beginning or end of week,month or quarter
 SET_DATE()     Sets and restores date format

SP_BOM

BOM()

  Short:
  ------
  BOM() Calculates beginning of the month date

  Returns:
  --------
  <dReturn> => Date which is beginning of the month

  Syntax:
  -------
  BOM(dTarget)

  Description:
  ------------
  Calculates date which is beginning of the month from
  <dTarget>

  Examples:
  ---------
   dDate := ctod("10/15/90")

   dBom  := BOM(DDate)    //    => 10/01/90

  Source:
  -------
  S_BOM.PRG

 

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()

Tools — Date/Time Functions

Introduction Date/Time Functions
ADDMONTH()   Adds or subtracts months to/from a date
BOM()        Determines the date of the first day of a month
BOQ()        Determines the date for the beginning of a quarter
BOY()        Determines the date for the beginning of a year
CTODOW()     Converts the day of the week name into a corresponding number
CTOMONTH()   Converts the name of the month into a corresponding number
DMY()        Returns a date in "DD Month YY" format
DOY()        Determines the day of the year for a specific date
EOM()        Determines the date for the last day of a month
EOQ()        Determines the date for the end of a quarter
EOY()        Determines the date for the end of the year
ISLEAP()     Tests if a specific year is a leap year
LASTDAYOM()  Determines the number of days in a month
MDY()        Returns a date in the "Month DD, YY" format
NTOCDOW()    Changes the number of a weekday into a weekday name
NTOCMONTH()  Changes the number of a month into a month name
QUARTER()    Determines the quarter in which a specific date lies
SECTOTIME()  Converts seconds into a time string
SETDATE()    Sets the system date
SETTIME()    Sets the system clock
SHOWTIME()   Continuously displays the time at desired screen position
STOD()       Converts an ANSI date string into Clipper format
TIMETOSEC()  Calculates the seconds since midnight
TIMEVALID()  Determines whether a specified time is valid
WAITPERIOD() Pauses a specified time in increments of 1/100 seconds
WEEK()       Returns the calendar week for a date
WOM()        Returns the week within a month.