- Publicity: Public Only All
acs-datetime-procs.tcl
Tcl library for the ACS Date-Time service package
- Location:
- packages/acs-datetime/tcl/acs-datetime-procs.tcl
- Created:
- 2000-11-21
- Author:
- ron@arsdigita.com
- CVS Identification:
$Id: acs-datetime-procs.tcl,v 1.19.2.5 2020/08/19 15:07:41 hectorr Exp $
Procedures in this file
- dt_ansi_to_julian (public)
- dt_ansi_to_julian_single_arg (public)
- dt_ansi_to_list (public)
- dt_ansi_to_pretty (public)
- dt_first_day_of_month (public)
- dt_format (public, deprecated)
- dt_interval_check (public)
- dt_julian_to_ansi (public)
- dt_month_abbrev (public)
- dt_month_names (public)
- dt_next_month (public)
- dt_next_month_name (public)
- dt_num_days_in_month (public)
- dt_prev_month (public)
- dt_prev_month_name (public)
- dt_sysdate (public)
- dt_systime (public)
- dt_valid_time_p (public)
- dt_widget_datetime (public)
- dt_widget_maybe_range (public)
- dt_widget_month_names (public)
- dt_widget_numeric_range (public)
Detailed information
dt_ansi_to_julian (public)
dt_ansi_to_julian year month day [ era ]
- Parameters:
- year
month
day
era (optional)
- 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_ansi_to_julian_single_arg (public)
dt_ansi_to_julian_single_arg ansi [ era ]
Splits the ANSI date into year, month and day, and calls dt_ansi_to_julian to transform it to Julian.
- Parameters:
- ansi
era (optional)
- Returns:
- the ANSI date as Julian
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_ansi_to_julian_single_arg
dt_ansi_to_list (public)
dt_ansi_to_list [ ansi_date ]
Parses the given ansi_date string into a list of year, month, day, hour, minute, and second. Works for any date than can be parsed by clock scan.
- Parameters:
- ansi_date (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_ansi_to_list
dt_ansi_to_pretty (public)
dt_ansi_to_pretty [ ansi_date ]
Converts an ANSI date into a localzed one. With no argument, it returns the current date based on server time. Works for both date and date-time strings.
- Parameters:
- ansi_date (optional) - Date in ANSI format (for example, 1998-09-05)
- Returns:
- Localized date (for example, on 'en_US', 05/09/98)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_localized_procs
dt_first_day_of_month (public)
dt_first_day_of_month year month
- Parameters:
- year
month
- Returns:
- the weekday number of the first day for the given month/year
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_first_day_of_month
dt_format (public, deprecated)
dt_format [ -format format ] [ -gmt gmt ] time
Deprecated. Invoking this procedure generates a warning.
This proc should not be used, because it does not take internationalization into account. Use lc_time_fmt instead.
- Switches:
- -format
(defaults to"%Y-%m-%d %H:%M:%S"
) (optional)- -gmt
(defaults to"f"
) (optional)- Parameters:
- time
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
dt_interval_check (public)
dt_interval_check start end
Checks the values of start and end to see if they form a valid time interval. Returns: > 0 if end > start 0 if end = start < 0 if end < start Input variables can be any strings that can be converted to times using clock scan.
- Parameters:
- start
end
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_interval_check
dt_julian_to_ansi (public)
dt_julian_to_ansi julian_date
- Parameters:
- julian_date
- Returns:
- julian_date formatted as "yyyy-mm-dd"
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_julian_to_ansi
dt_month_abbrev (public)
dt_month_abbrev
- Returns:
- the calendar month names as a Tcl list (Jan, Feb, ...)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_localized_procs
dt_month_names (public)
dt_month_names
- Returns:
- the calendar month names as a Tcl list (January, February, ...)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_localized_procs
dt_next_month (public)
dt_next_month year month
- Parameters:
- year
month
- Returns:
- the ANSI date for the next month
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_prev_next_month
dt_next_month_name (public)
dt_next_month_name year month
- Parameters:
- year
month
- Returns:
- Localized name of the next month
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_localized_procs
dt_num_days_in_month (public)
dt_num_days_in_month year month
- Parameters:
- year
month
- 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_prev_month (public)
dt_prev_month year month
- Parameters:
- year
month
- Returns:
- the ANSI date for the previous month
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_prev_next_month
dt_prev_month_name (public)
dt_prev_month_name year month
- Parameters:
- year
month
- Returns:
- Localized name of the previous month
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_localized_procs
dt_sysdate (public)
dt_sysdate [ -format format ]
- Switches:
- -format
(defaults to"%Y-%m-%d"
) (optional)- Returns:
- current server date in the standard format "yyyy-mm-dd"
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_sysdate_systime
dt_systime (public)
dt_systime [ -format format ] [ -gmt gmt ]
- Switches:
- -format
(defaults to"%Y-%m-%d %H:%M:%S"
) (optional)- -gmt
(defaults to"f"
) (optional)- returns the time in GMT.
- Returns:
- current server time in the standard format "yyyy-mm-dd hh:mi:ss".
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_sysdate_systime
dt_valid_time_p (public)
dt_valid_time_p time
- Parameters:
- time
- Returns:
- 1 if "time" is a valid time specification, 0 otherwise.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- dt_valid_time_p, dt_sysdate_systime
dt_widget_datetime (public)
dt_widget_datetime [ -show_date show_date ] \ [ -date_time_sep date_time_sep ] [ -use_am_pm use_am_pm ] \ [ -default default ] name [ granularity ]
- Switches:
- -show_date
(defaults to"1"
) (optional)- -date_time_sep
(defaults to" "
) (optional)- -use_am_pm
(defaults to"0"
) (optional)- -default
(defaults to"none"
) (optional)- Parameters:
- name
granularity (defaults to"days"
)
- Returns:
- an HTML form fragment for collecting date-time information with names "$name.year", "$name.month", "$name.day", "$name.hours", "$name.minutes", "$name.seconds", and "$name.ampm". These will be numeric ("ampm" is 0 for am, 1 for pm) Default specifies what should be set as the current time in the form. Valid defaults are "none", "now", or any valid date string that can be converted with clock scan. Granularity can be "months" "days" "hours" "halves" "quarters" "fives" "minutes" or "seconds". Use -show_date 0 for a time entry widget (no dates). All HTML widgets will be output *unless* show_date is 0; they will be hidden if not needed to satisfy the current granularity level. Values default to 1 for MM/DD and 0 for HH/MI/SS/AM if not found in the input string or if below the granularity threshold.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
dt_widget_maybe_range (public)
dt_widget_maybe_range [ -hide hide ] [ -hidden_value hidden_value ] \ [ -default default ] [ -format format ] ask_for_value name start \ end default_value [ interval ] [ with_leading_zeros ] \ [ hidden_value ]
- Switches:
- -hide
(defaults to"t"
) (optional)- -hidden_value
(defaults to"00"
) (optional)- -default
(optional)- -format
(defaults to"%02d"
) (optional)- Parameters:
- ask_for_value
name
start
end
default_value
interval (defaults to"1"
)
with_leading_zeros (defaults to"0"
)
hidden_value (defaults to"00"
)
- Returns:
- form numeric range, or hidden_value if ask_for_value is false.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
dt_widget_month_names (public)
dt_widget_month_names name [ selected_month ]
- Parameters:
- name
selected_month (defaults to"0"
)
- Returns:
- a select widget for months of the year.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
dt_widget_numeric_range (public)
dt_widget_numeric_range name begin end [ default ] [ interval ] \ [ with_leading_zeros ]
- Parameters:
- name
begin
end
default (optional)
interval (defaults to"1"
)
with_leading_zeros (defaults to"0"
)
- Returns:
- an HTML select widget for a numeric range
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.