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

Harbour 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

Year()

Year()

Converts the year portion of a date into a numeric value

Syntax

      Year(<cDate>) --> nYear

Arguments

<dDate> Any valid date expression

Returns

<nYear> The year portion of the date.

Description

This function returns the numeric value for the year in <dDate>. This value will always be a four-digit number and is not affected by the setting of the SET CENTURY and SET DATE commands.

Addition ally, an empty date expression passed to this function will yield a zero value.

Examples

      ? Year( Date() )
      ? Year( hb_SToD( "32510125" ) )

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Day(), Month()

ElapTime()

ELAPTIME()

Calculates elapted time.

Syntax

      ELAPTIME(<cStartTime>,<cEndTime>) --> cDiference

Arguments

<cStartTime> Start in time as a string format <cEndTime> End time as a string format

Returns

<cDiference> Difference between the times

Description

This function returns a string that shows the difference between the starting time represented as <cStartTime> and the ending time as <cEndTime>. If the stating time is greater then the ending time, the function will assume that the date changed once.

Examples

      STATIC s_cStartTime
      INIT PROCEDURE Startup()
         s_cStartTime := Time()
         RETURN
      EXIT PROCEDURE StartExit()
         ? "You used this program by", ElapTime( s_cStartTime, Time() )
         RETURN

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

SECS(), SECONDS(), TIME(), DAY()

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

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

CDoW()

 

CDOW()

Converts a date to the day of week

Syntax

      CDOW(<dDate>)  --> cDay

Arguments

<dDate> Any date expression.

Returns

<cDay> The current day of week.

Description

This function returns a character string of the day of the week, from a date expression <dDate> passed to it. If a NULL date is passed to the function, the value of the function will be a NULL byte.

Examples

      ? CDOW( Date() )
      IF CDOW( Date() + 10 ) == "Sunday"
         ? "This is a sunny day."
      ENDIF

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

DAY(), DOW(), DATE(), CMONTH()