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

Time()

Time()

Returns the system time as a string

Syntax

      Time() --> cTime

Arguments

None

Returns

<cTime> Character string representing time

Description

This function returns the system time represented as a character expression in the format of HH:MM:SS

Examples

      ? Time()

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Date(), Seconds()

Secs()

Secs()

Return the number of seconds from the system date.

Syntax

      Secs( <cTime> ) --> nSeconds

Arguments

<cTime> Character expression in a time string format

Returns

<nSeconds> Number of seconds

Description

This function returns a numeric value that is a number of elapsed seconds from midnight based on a time string given as <cTime>.

Examples

      ? Secs( Time() )
      ? Secs( Time() - 10 )

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Seconds(), ElapTime(), Time()

Seconds()

Seconds()

Returns the number of elapsed seconds past midnight.

Syntax

      Seconds() --> nSeconds

Arguments

None

Returns

<nSeconds> Number of seconds since midnight

Description

This function returns a numeric value representing the number of elapsed seconds based on the current system time. The system time is considered to start at 0 (midnight); it continues up to 86399 seconds. The value of the return expression is displayed in both seconds and hundredths of seconds.

Examples

      ? Seconds()

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Time()

Month()

MONTH()

Converts a date expression to a month value

Syntax

      MONTH(<dDate>) --> nMonth

Arguments

<dDate> Any valid date expression

Returns

<nMonth> Corresponding number of the month in the year, ranging from 0 to 12

Description

This function returns a number that represents the month of a given date expression <dDate>. If a NULL date (CTOD(”)) is passed to the function, the value of the function will be 0.

Examples

      ? Month( Date() )

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

CDOW(), DOW(), YEAR(), CMONTH()

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

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