dt_ansi_to_julian (public)

 dt_ansi_to_julian year month day [ era ]

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

Parameters:
year (required)
month (required)
day (required)
era (optional)
this argument is obsolete and passing it to the proc will generate a warning.
Returns:
the ANSI date as Julian or -1 in the case of an invalid ANSI date argument (year less than 4713 BCE, greater than 9999 CE, or equal to 0)

Partial Call Graph (max 5 caller/called nodes):
test_dt_ansi_to_julian dt_ansi_to_julian (test acs-datetime) dt_ansi_to_julian dt_ansi_to_julian test_dt_ansi_to_julian->dt_ansi_to_julian test_dt_date_rollover_errors dt_date_rollover_errors (test acs-datetime) test_dt_date_rollover_errors->dt_ansi_to_julian test_dt_early_years dt_early_years (test acs-datetime) test_dt_early_years->dt_ansi_to_julian test_dt_legacy_short_years dt_legacy_short_years (test acs-datetime) test_dt_legacy_short_years->dt_ansi_to_julian ad_log ad_log (public) dt_ansi_to_julian->ad_log dt_make_ansi_date dt_make_ansi_date (private) dt_ansi_to_julian->dt_make_ansi_date dt_ansi_to_julian_single_arg dt_ansi_to_julian_single_arg (public) dt_ansi_to_julian_single_arg->dt_ansi_to_julian dt_get_info dt_get_info (public) dt_get_info->dt_ansi_to_julian dt_widget_month dt_widget_month (public, deprecated) dt_widget_month->dt_ansi_to_julian packages/calendar/www/view-list-display.tcl packages/calendar/ www/view-list-display.tcl packages/calendar/www/view-list-display.tcl->dt_ansi_to_julian packages/calendar/www/view-month-display.tcl packages/calendar/ www/view-month-display.tcl packages/calendar/www/view-month-display.tcl->dt_ansi_to_julian

Testcases:
dt_ansi_to_julian, dt_early_years, dt_date_rollover_errors, dt_legacy_short_years
Source code:
    if {$era ne ""} {
        ad_log warning "'era' argument is obsolete"
    }

    try {
        set date [dt_make_ansi_date $year $month $day]
        # This procedure historically uses an explicit %Y format, which rejects
        # short years instead of applying the free-form century interpretation.
        if {[string length [string trim $year]] < 3
            || ([string length [string trim $year]] < 4 && [scan $year %d] == 0)} {
            set date "$year-$month-$day"
        }
        return [clock format [clock scan $date -format %Y-%m-%d] -format %J]
    } on error {errmsg} {
        ad_log warning "Cannot convert ${year}-${month}-${day} to Julian date: $errmsg"
        return -1
    }
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: