The following table offers examples of the various date and time functions:

Procedure Result
dt_systime 2024-11-22 04:59:09
dt_systime -gmt t 2024-11-22 03:59:09
dt_systime -format "%Y-%m-%d %H:%M:%S %Z" 2024-11-22 04:59:09 +0100
dt_sysdate 2024-11-22
dt_sysdate -format "%b %d, %Y" Nov 22, 2024
dt_sysdate -format "%b %e, %Y" Nov 22, 2024
dt_ansi_to_pretty 11/22/24
dt_ansi_to_list 2024 11 22 4 59 9
dt_julian_to_ansi 2451915 2001-01-05
dt_month_names {January} {February} {March} {April} {May} {June} {July} {August} {September} {October} {November} {December}
dt_month_abbrev {Jan} {Feb} {Mar} {Apr} {May} {Jun} {Jul} {Aug} {Sep} {Oct} {Nov} {Dec}
dt_valid_time_p "bad date" 0
dt_valid_time_p "2001-01-05" 1
dt_valid_time_p "2001-01-05 12:00 pm" 1
dt_interval_check "2001-01-01" "2001-02-01" 2678400
dt_interval_check "2001-02-01" "2001-02-01" 0
dt_interval_check "2001-02-01" "2001-01-01" -2678400

Notes

  1. Any timezone-specific information will be based on the host configuration where the server is running.
  2. Without a supplied date or time argument, all procedures return results based on the current server time.
  3. The format argument used by dt_sysdate and dt_systime accepts any of the formatting codes supported by the Tcl clock format procedure, which is used for the underlying processing. See current documentation at http:///www.tcl.tk/man/.
  4. All procedures that take date or time as an input argument are capable of accepting these inputs in any format capable of being parsed by clock scan. This includes virtually all ordinary date and time formats, including am/pm and timezone qualifiers.