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

Procedure Result
dt_systime 2024-05-03 13:45:14
dt_systime -gmt t 2024-05-03 11:45:14
dt_systime -format "%Y-%m-%d %H:%M:%S %Z" 2024-05-03 13:45:14 +0200
dt_sysdate 2024-05-03
dt_sysdate -format "%b %d, %Y" May 03, 2024
dt_sysdate -format "%b %e, %Y" May 3, 2024
dt_ansi_to_pretty 05/03/24
dt_ansi_to_list 2024 5 3 13 45 14
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.