Harbour All Functions – D

Date()
Day()
Days()

DaysInMonth()
DaysToMonth()

dbAppend()
dbClearFilter()
dbCloseAll()
dbCloseArea()
dbCommit()
dbCommitAll()
dbCreate()
dbDelete()
dbEval()
dbF()
dbFilter()
dbGoBottom()
dbGoTo()
dbGoTop()
dbReCall()
dbRLock()
dbRLockList()
dbRUnlock()
dbSeek()
dbSelectArea()
dbSetDriver()
dbSetFilter()
dbSkip()
dbSkipper()
dbStruct()
dbUnlock()
dbUnlockAll()
dbUseArea()

DecToBin()
DecToHexa()
DecToOctal()

Deleted()
Descend()
DevOutPict()
DirChange()
DirRemove()
DiskSpace()

DMY()
Do()
DoW()

DOY
DToC()

DToR
DToS()

Date & Time Functions

Date & Time Functions

ADays Returns an array with the days names
AddMonth Adds or subtracts months to/from a date
AMonths Returns an array with the months names
BOM Beginning date Of Month of given date
BOQ Date of beginning Of quarter containing given date
BOY Date to find first day of year, default is DATE()
CDoW Converts a date to the day of week
CMonth Return the name of the month
CToD Converts a character string to a date expression
CToDoW Convert name of day of the week to its ordinal number
CToMonth Convert name of month to its ordinal number
Date Return the Current OS Date
Day Return the numeric day of the month
Days Convert elapsed seconds into days
DaysInMonth Returns the number of days in month
DaysToMonth Total number of days from first of Jan to beginning of nMonth
DMY Returns the date as a string in DD Month YY format
DoW Value for the day of week
DOY Determines the day of the year for a specific date
DToC Date to character conversion
DToS Date to string conversion
ElapTime Calculates elapted time
EOM End Of Month
EOQ Date of end of quarter
EOY Last date Of Year
IsLeap Tests if a specific year is a leap year
IsLeapYear Checks if the given date is a leap year
LastDayOM Determines the number of days in a month
MDY Returns the date as a string in Month DD, YY or Month DD, YYYY
Month Converts a date expression to a month value
NToCDoW Find day name by num of day
NToCMonth Find a month name by the number of month
Quarter Returns a number equal to the quarter in which a date falls
Seconds Returns the number of elapsed seconds past midnight
Secs Return the number of seconds from the system date
SecToTime Converts seconds into a time string
Time Returns the system time as a string
TimeValid Determines whether a specified time is valid
TimeToSec Calculates the seconds since midnight
WaitPeriod Pauses a specified time in increments of 1/100 seconds
Week Returns the calendar week a number
WOY Gets the week number of the year
Year Converts the year portion of a date into a numeric value

DToS()

DTOS()

Date to string conversion

Syntax

      DTOS(<dDateString>)  --> cDate

Arguments

<dDateString> Any date

Returns

<dDate> String notation of the date

Description

This function returns the value of <dDateString> as a character string in the format of YYYYMMDD. If the value of <dDateString> is an empty date, this function will return eight blank spaces.

Examples

      ? DToS( Date() )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

DTOC(), DATE(), DTOS()

DToC()

DTOC()

Date to character conversion

Syntax

      DTOC(<dDateString>)  --> cDate

Arguments

<dDateString> Any date

Returns

<dDate> Character represention of date

Description

This function converts any date expression (a field or variable) expressed as <dDateString> to a character expression in the default format “MM/DD/YY”. The date format expressed by this function is controled in part by the date format specified in the SET DATE command

Examples

      ? DToC( Date() )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SET DATE, DATE(), DTOS()

DoW()

DOW()

Value for the day of week.

Syntax

      DOW(<dDate>) --> nDay

Arguments

<dDate> Any valid date expression

Returns

<nDay> The current day number

Description

This function returns the number representing the day of the week for the date expressed as <dDate>.

Examples

      ? DOW( Date() )
      ? DOW( Date() - 6584 )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

DTOC(), CDOW(), DATE(), DTOS(), DAY()

Day()

 

DAY()

Return the numeric day of the month.

Syntax

      DAY(<cDate>) --> nMonth

Arguments

<cDate> Any valid date expression.

Returns

<nMonth> Numeric value of the day of month.

Description

This function returns the numeric value of the day of month from a date.

Examples

      ? Day( Date() )
      ? Day( Date() + 6325 )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

CTOD(), DTOS(), DTOC(), DATE(), MONTH(), CMONTH()

Date()

 

DATE()

 

Return the Current OS Date

Syntax

      DATE() --> dCurDate

Arguments

None

Returns

<dCurDate> Current system date.

Description

This function returns the current system date.

Examples

      ? Date()

Tests

      ? "Today is ",Day(Date())," of ",cMonth(Date())," of ",Year(Date())

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

CTOD(), DTOS(), DTOC(), DAY(), MONTH(), CMONTH()

CToD()

 

CTOD()

Converts a character string to a date expression

Syntax

      CTOD(<cDateString>)  --> dDate

Arguments

<cDateString> A character date in format ‘mm/dd/yy’

Returns

<dDate> A date expression

Description

This function converts a date that has been entered as a character expression to a date expression. The character expression will be in the form “MM/DD/YY” (based on the default value in SET DATE) or in the appropriate format specified by the SET DATE TO command. If an improper character string is passed to the function, an empty date value will be returned.

Examples

      ? CToD( "12/21/00" )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SET DATE, DATE(), DTOS()

SP_BLDNDX

BLDNDX()

  Short:
  ------
  BLDNDX() Interactively create a new index

  Returns:
  --------
  <cIndexName> => New index name less extension

  Syntax:
  -------
  BLDNDX([aFields,aDescriptions],[aIndexfiles],[Buildex])

  Description:
  ------------
  Allows point and shoot building of a new index.

  [aFields] - an array of legal field names. If not
  passed, all fields  in current DBF will be used.

  [aDescriptions] - an array of field descriptions. If
  not passed,field names  in current DBF will be used.

  Pass both or neither of  [aFields] and
  [aDescriptions].

  [aIndexFiles]   - an array of currently open index
  files to be reopened on exit from bldndx() (up to 10).
  Otherwise, only the newly created index file will be left open.

  [lBuildex]  - allow use of Buildex() to build complex
  expressions. Default is False.

  Examples:
  ---------
   BLDNDX()

    -- or --

   aNdxFlds  := {"LASTNAME","FIRSTNAME","CITY"}
   aNdxDesc  := {"Last Name","First Name","City"}
   aNdxOpen  := {"CUSTOMER","STATE","ZIPCODE"}
   BLDNDX(aNdxFlds,aNdxDesc,aNdxOpen)
   BLDNDX(nil,nil,aNdxOpen,.t.)   // use buildex()

  Warnings:
  ----------
  Indexes created with this function will require the
  functions DTOS() and NBR2STR() be loaded prior to use if a date
  or numeric field is part of the index. You can do this with the
  EXTERNAL statement.

  EXTERNAL DTOS, NBR2STR

  Notes:
  -------
  All fields are converted to type Character. The
  function NBR2STR() is used to create a usable character
  expression from a numeric field by first adding 1,000,000 to the
  number.

  Source:
  -------
  S_BLDNDX.PRG

 

C5_DTOS

 DTOS()
 Convert a date value to a character string formatted as yyyymmdd
------------------------------------------------------------------------------
 Syntax

     DTOS(<dDate>) --> cDate

 Arguments

     <dDate> is the date value to convert.

 Returns

     DTOS() returns a character string eight characters long in the format
     yyyymmdd.  When <dDate> is a null date (CTOD("")), DTOS() returns a
     string of eight spaces.  The return value is not affected by the current
     date format.

 Description

     DTOS() is a date conversion function that is used when creating index
     expressions consisting of a date value and a character expression.
     DTOS() converts a date value to a character string that can be
     concatenated to any other character expression.  The return value is
     structured to preserve date order (year, month, and day).

 Examples

     .  These examples illustrate DTOS() in conjunction with several
        other functions:

        ? DATE()                        // Result: 09/01/90

        ? DTOS(DATE())                  // Result: 19900901
        ? LEN(DTOS(CTOD("")))           // Result: 8

     .  This example demonstrates how to create an index with a
        compound date and character key using DTOS():

        USE Sales NEW
        INDEX ON DTOS(Date) + Salesman TO DateName

 Files   Library is CLIPPER.LIB.

See Also: CTOD() DATE() DTOC() INDEX