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