dt_num_days_in_month (public)

 dt_num_days_in_month year month

Defined in packages/acs-datetime/tcl/acs-datetime-procs.tcl

Parameters:
year (required)
month (required)
Returns:
the numbers of days for the given month/year

Partial Call Graph (max 5 caller/called nodes):
test_dt_date_rollover_errors dt_date_rollover_errors (test acs-datetime) dt_num_days_in_month dt_num_days_in_month test_dt_date_rollover_errors->dt_num_days_in_month test_dt_early_years dt_early_years (test acs-datetime) test_dt_early_years->dt_num_days_in_month test_dt_legacy_short_years dt_legacy_short_years (test acs-datetime) test_dt_legacy_short_years->dt_num_days_in_month test_dt_num_days_in_month dt_num_days_in_month (test acs-datetime) test_dt_num_days_in_month->dt_num_days_in_month dt_make_ansi_date dt_make_ansi_date (private) dt_num_days_in_month->dt_make_ansi_date dt_get_info dt_get_info (public) dt_get_info->dt_num_days_in_month

Testcases:
dt_num_days_in_month, dt_early_years, dt_date_rollover_errors, dt_legacy_short_years
Source code:
    # Normalize before arithmetic as well as before constructing the date.
    set date [dt_make_ansi_date $year $month 1]
    scan $date %d year
    scan $month %d month
    if {$month == 0} {
        set month 01
    } elseif {$month == 12} {
        incr year
        set month 01
    } elseif {$month == 13} {
        incr year
        set month 02
    } else {
        incr month
    }

    return [clock format [clock scan "last day" -base [clock scan [dt_make_ansi_date $year $month 1] -format %Y-%m-%d]] -format %d]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-datetime/tcl/acs-datetime-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: