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