You are here

Date Package for TCL

admin의 아바타

홈페이지 : http://web.uvic.ca/%7Eerempel/tcl/DatePkg/DatePkg.html

Date::SetFormat DateFormat 
SetFormat must be called before any other date routines are used. Setformat may be called again to change the format that you wish to operate in.
The DateFormat may be any combination of characters that include 

YYYY - four digit year 
YY - two digit year 
MM - two digit month 
MMM - three character month 
DD - two digit day 
DDD - day of week short format (2.10 newer) - DD still required 
DDDD - day of week long format (2.10 newer) - DD still requried 
T24 - 24 hour time without seconds 
T24S - 24 hour time with seconds 
T12 - 12 hour time without seconds 
T12S - 12 hour time with seconds 
m - AM/PM indicator 
any other text 
Date::SetFormat "MMM, DD/YYYY T12m"

Date::GetFormat 
Return the string used to set the current date format. This is usefull to save the current date format, temporarily set a new date format and finally set the format back to the original.

Date::Compare Date1 Date2 
Compare the date and time according to the DateFormat returning


Date1  Date2 return 1


Date::Adjust Date Adjustment 
Return a new Date that is advanced or retreated by the adjustment specified. Adjustments can be any combination of years, months, weeks days, hours, minutes or seconds with an optional modifier of "ago" to indicate in the past.

The adjustment may also be the full day of the week (Thursday) to return the same time on the specified day of the week that Date falls in. Sunday is the first day of the week.

Date::Today ?relative? 
Return the current date from the operating system with the time specified by relative.

Date::Now 
Return the current date and time from the operating system

Date::WeekDay Date ?S|L|N? 
Return the current day of the week in either short, long or numeric form. The default is short.

Date::Day Date ?S|L? 
Return the current day of the month in either short (no leading zero) or long (always two digits). The default is short.

Date::Month Date ?S|L|N? 
Return the current month of the year in either short, long or numeric form. The default is short.

Date::Year Date ?L|S? 
Return the year in either long (4 digit), or short (2 digit) format. The default is long.

Date::Hour Date ?S|L? 
Return the hour in either long (2 digit), or short (no leading zero) format. The default is short.

Date::Minute Date ?S|L? 
Return the minute in either long (2 digit), or short (no leading zero) format. The default is short.

Date::Second Date ?S|L? 
Return the second in either long (2 digit), or short (no leading zero) format. The default is short.

Date::Convert Date Format 
Convert the date specified in the format set with SetFormat to the format specified in Format. See SetFormat for the options of Format.

Date::Apart Date1 Date2 
Return a string specifying the number of days, hours, minutes and seconds from Date1 to Date2. This information is in a format ready for the Adjust routine.

Date::Seconds DateApart 
Return the number of seconds equivilent to the contents of the string DateApart. DateAppart must be in the format returned by the Apart routine. This is included so that you can set timers using the TCL after command based on date differences.

Date::Parse DateString 
Interpret the format free date DateString and return a string date of the format specified with SetFormat.

Date::Test ?detail? 
Test the most critical date routines. Returns 0 if no errors encountered, otherwise return 1. If "detail" is included, display the results of the tests as they are made.
첨부 파일파일 크기
File date29.tcl17.13 KB