
Best viewed with
|
|
Unit: cwUtil
Functions
cwLeapYear,
cwDaysInMonth,
cwDayOfWeek,
cwDate,
cwTime,
cwYear,
cwMonth,
cwDay,
cwHour,
cwMin,
cwSec,
cwMSec,
cwtsEQ,
cwtsGT,
cwtsGTE,
cwtsLT,
cwtsLTE,
cwMinDateTime,
cwMaxDateTime,
 |
|
cwLeapYear
|
|
|
function cwLeapYear(Year: Integer): Boolean
|
|
|
Description
|
Use cwLeapYear to determine whether a given year is a leap year
|
|
|
Returns
|
True if Year is a leap year otherwise returns false
|
 |
|
cwDaysInMonth
|
|
|
function cwDaysInMonth(Year, Month: Integer): Integer
|
|
|
Description
|
Use cwDaysInMonth to determine the
number of days in the month for a given year
|
|
|
Returns
|
Number of days in the month (1-31)
|
 |
|
cwDayOfWeek
|
|
|
function cwDayOfWeek(Date : TDate) : integer
|
|
|
Description
|
Use cwDayOfWeek to determine the day of the
week for the given Date.
|
|
|
Returns
|
Returns the day of week (1 = Sunday, 2 = Monday ... 6 =
Saturday)
|
 |
|
cwDate
|
|
|
function cwDate(Yr, Mon, Day : integer) : TDate
|
|
|
Description
|
Use cwDate to obtain a TDate representing the
given year, month and day.
|
|
|
Returns
|
The TDate representing the year, month and day
|
|
|
Unlike the Delphi EncodeDate function cwDate
handles values for month which are larger than 12, and values for
day which are larger than 31.
|
|
|
|
Calling cwDate for the 32nd of January 2000 would
actually return 1st Febuary 2000
MyDate := cwDate(2000, 1, 32); { Returns 1st Feb 2000 }
|
|
|
|
Calling cwDate for the 1st of the 13th month of 2000 would
actually return 1st January 2001
MyDate := cwDate(2000, 13, 1); { Returns 1st Jan 2001 }
|
 |
|
cwTime
|
|
|
function cwTime(Hr, Min, Sec, MSec : integer) : TTime
|
|
|
Description
|
Use cwTime to obtain a TTime representing the
given hour, minute, second and millisecond.
|
|
|
Returns
|
The TTime representing the hour, minute, second and millisecond
|
|
|
Unlike the Delphi EncodeTime function cwTime
handles values for hour which are larger than 23, values for
minutes and seconds which are larger than 59, and values for milliseconds
which are larger than 999.
|
|
|
|
Calling cwTime for the 60th minute of 9am would
actually return 10am
MyTime := cwTime(9, 60, 0, 0); { Returns 10am }
|
 |
|
cwYear
|
|
|
function cwYear(Date : TDate) : integer
|
|
|
Description
|
Use cwYear to return the year for the given date
|
|
|
Returns
|
Year for the given date
|
 |
|
cwMonth
|
|
|
function cwMonth(Date : TDate) : integer
|
|
|
Description
|
Use cwMonth to return the month for the given date
|
|
|
Returns
|
Month for the given date
|
 |
|
cwDay
|
|
|
function cwDay(Date : TDate) : integer
|
|
|
Description
|
Use cwDay to return the day for the given date
|
|
|
Returns
|
Day for the given date
|
 |
|
cwHour
|
|
|
function cwHour(Time : TTime) : integer
|
|
|
Description
|
Use cwHour to return the hour for the given time
|
|
|
Returns
|
Hour for the given time
|
 |
|
cwMin
|
|
|
function cwMin(Time : TTime) : integer
|
|
|
Description
|
Use cwMin to return the minute for the given time
|
|
|
Returns
|
Minute for the given time
|
 |
|
cwSec
|
|
|
function cwSec(Time : TTime) : integer
|
|
|
Description
|
Use cwSec to return the second for the given time
|
|
|
Returns
|
Second for the given time
|
 |
|
cwMSec
|
|
|
function cwMSec(Time : TTime) : integer
|
|
|
Description
|
Use cwMSec to return the millisecond for the given time
|
|
|
Returns
|
Millisecond for the given time
|
 |
|
cwtsEQ
|
|
|
function cwtsEQ(DateTime1, DateTime2 : TDateTime) : boolean
|
|
|
Description
|
Use cwtsEQ to compare two TDateTimes for
equality. The function compares the TDateTimes using
high precision
TTimeStamps
|
 |
|
cwtsGT
|
|
|
function cwtsGT(DateTime1, DateTime2 : TDateTime) : boolean
|
|
|
Description
|
Use cwtsGT to see if DateTime1 is greater than
DateTime2. The function compares the TDateTimes using
high precision
TTimeStamps
|
 |
|
cwtsGTE
|
|
|
function cwtsGTE(DateTime1, DateTime2 : TDateTime) : boolean
|
|
|
Description
|
Use cwtsGTE to see if DateTime1 is greater than
or equal to
DateTime2. The function compares the TDateTimes using
high precision
TTimeStamps
|
 |
|
cwtsLT
|
|
|
function cwtsLT(DateTime1, DateTime2 : TDateTime) : boolean
|
|
|
Description
|
Use cwtsLT to see if DateTime1 is less than
DateTime2. The function compares the TDateTimes using
high precision
TTimeStamps
|
 |
|
cwtsLTE
|
|
|
function cwtsLTE(DateTime1, DateTime2 : TDateTime) : boolean
|
|
|
Description
|
Use cwtsLTE to see if DateTime1 is less than
or equal to
DateTime2. The function compares the TDateTimes using
high precision
TTimeStamps
|
 |
|
cwMinDateTime
|
|
|
function cwMinDateTime(a, b : TDateTime) : TDateTime
|
|
|
Description
|
Use cwMinDateTime to find the minimum of two
TDateTimes
|
 |
|
cwMaxDateTime
|
|
|
function cwMaxDateTime(a, b : TDateTime) : TDateTime
|
|
|
Description
|
Use cwMaxDateTime to find the maximum of two
TDateTimes
|
|
Copyright © 1998-2007 Innova Software ALL RIGHTS RESERVED
All trademarks are the property of their respective owners.
Webmaster webmaster@innovasoftware.com
|