get_date_period

 

Description

The function counts the number of day of a period of one year, one quarter, and so on.

Syntax

double get_date_period(DATEPERIOD period, int times = 1)

Parameters

period
[input] the type of period. Can be one of the following:
enum DATEPERIOD
{
        DATEPERIOD_YEAR,
        DATEPERIOD_QUARTER,
        DATEPERIOD_MONTH,
        DATEPERIOD_WEEK,
        DATEPERIOD_DAY,
        DATEPERIOD_HOUR,
        DATEPERIOD_MINUTE,
        DATEPERIOD_SECOND,
};
times
[input] the number of period to be counted.

Return

returns the period

Examples

EX1

void get_date_period_ex1()
{
        double dd = get_date_period(DATEPERIOD_YEAR);
        out_double("Period of one year = ", dd);
        
        dd = get_date_period(DATEPERIOD_QUARTER);
        out_double("Period of one quarter = ", dd);
        
        dd = get_date_period(DATEPERIOD_WEEK, 2);
        out_double("Period of two weeks = ", dd);
}

Remark

See Also

header to Include

labutils.h

Reference