dt_make_ansi_date (private)

 dt_make_ansi_date year month day

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

Construct an ISO date from decimal components without interpreting leading zeros as octal. Leave calendar rollover to clock scan rather than imposing stricter civil-date validation here. One- and two-digit years retain Tcl's legacy century interpretation; four-digit years are literal.

Parameters:
year (required)
month (required)
day (required)

Partial Call Graph (max 5 caller/called nodes):
dt_ansi_to_julian dt_ansi_to_julian (public) dt_make_ansi_date dt_make_ansi_date dt_ansi_to_julian->dt_make_ansi_date dt_first_day_of_month dt_first_day_of_month (public) dt_first_day_of_month->dt_make_ansi_date dt_get_info dt_get_info (public) dt_get_info->dt_make_ansi_date dt_next_month dt_next_month (public) dt_next_month->dt_make_ansi_date dt_next_month_name dt_next_month_name (public) dt_next_month_name->dt_make_ansi_date

Testcases:
No testcase defined.
Source code:
    set year_text [string trim $year]
    foreach component {year month day} {
        set value [string trim [set $component]]
        if {![regexp {^[+-]?[0-9]+$} $value]} {
            error "Invalid decimal date component: $value"
        }
        scan $value %d $component
    }
    if {[regexp {^[0-9]{1,2}$} $year_text]} {
        set year [clock format [clock scan "$year_text-01-01"] -format %Y]
        scan $year %d year
    }
    return [format %04d-%02d-%02d $year $month $day]
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: