Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #11  
Old 02-21-2002, 01:31 AM
Ted On The NeT Ted On The NeT is offline
Senior Member
 
Join Date: Apr 2001
Posts: 2,182
Default RE: DateToWeek function?

Andy,

thanks for helping, but your function is incorrect too.. sorry. Take a look: if I use the original function you pasted, these are the results:
01-01-1990 = 1
01-01-1991 = 1
01-01-1992 = 1
01-01-1993 = 53
01-01-1994 = 52
01-01-1995 = 52
01-01-1996 = 1
01-01-1997 = 1
01-01-1998 = 1 // ERROR: SHOULD BE 53
01-01-1999 = 53 // ERROR: SHOULD BE 52
01-01-2000 = 52
01-01-2001 = 1
01-01-2002 = 1
01-01-2003 = 1
01-01-2004 = 1 // ERROR: SHOULD BE 53
01-01-2005 = 53 // ERROR: SHOULD BE 52
01-01-2006 = 52
01-01-2007 = 1
01-01-2008 = 1
01-01-2009 = 1 // ERROR: SHOULD BE 53
01-01-2010 = 53 // ERROR: SHOULD BE 52
01-01-2011 = 52
01-01-2012 = 52
01-01-2013 = 1
01-01-2014 = 1
01-01-2015 = 1 // ERROR: SHOULD BE 53
01-01-2016 = 53 // ERROR: SHOULD BE 52
01-01-2017 = 52
01-01-2018 = 1
01-01-2019 = 1
01-01-2020 = 1
01-01-2021 = 53
01-01-2022 = 52
01-01-2023 = 52
01-01-2024 = 1
01-01-2025 = 1
01-01-2026 = 1 // ERROR: SHOULD BE 53
01-01-2027 = 53 // ERROR: SHOULD BE 52
01-01-2028 = 52
01-01-2029 = 1
01-01-2030 = 1


If I alter the shiftfase from 12 to 11, you'll see the errors on different spots.
01-01-1990 = 1
01-01-1991 = 1
01-01-1992 = 1
01-01-1993 = 53
01-01-1994 = 52
01-01-1995 = 1 // ERROR: SHOULD BE 52
01-01-1996 = 1
01-01-1997 = 1
01-01-1998 = 53
01-01-1999 = 52
01-01-2000 = 52
01-01-2001 = 1
01-01-2002 = 1
01-01-2003 = 1
01-01-2004 = 53
01-01-2005 = 52
01-01-2006 = 1 // ERROR: SHOULD BE 52
01-01-2007 = 1
01-01-2008 = 1
01-01-2009 = 53
01-01-2010 = 52
01-01-2011 = 52
01-01-2012 = 1 // ERROR: SHOULD BE 52
01-01-2013 = 1
01-01-2014 = 1
01-01-2015 = 53
01-01-2016 = 52
01-01-2017 = 1 // ERROR: SHOULD BE 52
01-01-2018 = 1
01-01-2019 = 1
01-01-2020 = 1
01-01-2021 = 53
01-01-2022 = 52
01-01-2023 = 1 // ERROR: SHOULD BE 52
01-01-2024 = 1
01-01-2025 = 1
01-01-2026 = 53
01-01-2027 = 52
01-01-2028 = 52
01-01-2029 = 1
01-01-2030 = 1



Greetz,
::TeD On The NeT::

=[ QUESTIONS ]=========================================
don't forget to accept this reply if it helped you!
================================================== =====

=[ EXTRA INFO ]========================================
Location : Netherlands (GMT +01.00)
Languages : English, Dutch, German
Age : 25
ICQ : Be smart and figure out what my UIN is...
================================================== =====
Reply With Quote
  #12  
Old 02-21-2002, 01:52 AM
Ted On The NeT Ted On The NeT is offline
Senior Member
 
Join Date: Apr 2001
Posts: 2,182
Default RE: DateToWeek function?

Andy,

i found the problem. It does not have to do with a wednesday/thursday problem, but the problem in your function is, that it's not a wednesday, but a friday that might be the first of the week. the problems come up when the friday is january 1st. so, it's not correctly writen here: http://www.merlyn.demon.co.uk/weekinfo.htm

This won't work (1/2):
function WeekNo(date: TDateTime): integer;
var
y, m, d: word;
h: integer;
FirstofJanuary, FirstDay, FirstWeekStart: TDateTime;
begin
Decodedate(date, y, m, d);
FirstofJanuary := Encodedate(y, 1, 1);
h := dayOfWeek(FirstofJanuary);
FirstDay := FirstofJanuary + ((12 - h) mod 7);
FirstWeekStart := FirstDay - 3;
if trunc(date) < FirstWeekStart then
result := WeekNo(FirstofJanuary - 1) (* 12-31 of previous year *)
else
result := (round(trunc(date) - FirstWeekStart) div 7) + 1;
end;


Neither will this work (2/2):
function WeekNo(date: TDateTime): integer;
var
y, m, d: word;
h: integer;
FirstofJanuary, FirstDay, FirstWeekStart: TDateTime;
begin
Decodedate(date, y, m, d);
FirstofJanuary := Encodedate(y, 1, 1);
h := dayOfWeek(FirstofJanuary);
FirstDay := FirstofJanuary + ((11 - h) mod 7);
FirstWeekStart := FirstDay - 3;
if trunc(date) < FirstWeekStart then
result := WeekNo(FirstofJanuary - 1) (* 12-31 of previous year *)
else
result := (round(trunc(date) - FirstWeekStart) div 7) + 1;
end;



But this does the trick (in my case):
function WeekNo(date: TDateTime): integer;
var
y, m, d: word;
h: integer;
FirstofJanuary, FirstDay, FirstWeekStart: TDateTime;
begin
Decodedate(date, y, m, d);
FirstofJanuary := Encodedate(y, 1, 1);
h := dayOfWeek(FirstofJanuary);
FirstDay := FirstofJanuary + ((11 - h) mod 7)+1;
FirstWeekStart := FirstDay - 3;
if trunc(date) < FirstWeekStart then
result := WeekNo(FirstofJanuary - 1) (* 12-31 of previous year *)
else
result := (round(trunc(date) - FirstWeekStart) div 7) + 1;
end;



Thanx all, for all your quick responses. I'll accept Andy's reply for helping me on track.


Greetz,
::TeD On The NeT::

=[ QUESTIONS ]=========================================
don't forget to accept this reply if it helped you!
================================================== =====

=[ EXTRA INFO ]========================================
Location : Netherlands (GMT +01.00)
Languages : English, Dutch, German
Age : 25
ICQ : Be smart and figure out what my UIN is...
================================================== =====
Reply With Quote
  #13  
Old 02-21-2002, 01:53 AM
andyho andyho is offline
Senior Member
 
Join Date: Jul 2001
Posts: 1,446
Default RE: DateToWeek function?

No, it is correct. For example in 1998 January 1st is a Thursday, that means that that week (if starting from Monday) has four days in 1998, and three days in 1997 - thus it is week 1 (according to the ISO standard). And that of course also shifts the first week of 1999 by 1.

By the distribution of week 1 vs. week 52/53 you seem to use a more unusual definition of week 1, as if the majority of the week makes it week 1 it means that 4 out of 7 years January 1st is in week 1 - but you have 4 out of 7 with week 52/53. I can produce your pattern by changing my code to this one:

FirstWednesday:=FirstofJanuary+((11-h) mod 7);
FirstWeekStart:=FirstWednesday-2;

But that means you define the week start on Monday, and define week 1 as the one which contains at least 5 days. Or maybe this definition is because it then contains the majority of working days in week one?

As I am also interested in calendrical stuff - can you find out more about where you got this definition? Is it the one usually used in Netherlands? According to that week website all of the EU should have adopted the ISO at least for official and business use. We can of course do that discussion in email (andy@hoerstemeier.de), it seems to get a bit too much special for this forum.

Bye,
Andy
Reply With Quote
  #14  
Old 02-21-2002, 02:07 PM
Ted On The NeT Ted On The NeT is offline
Senior Member
 
Join Date: Apr 2001
Posts: 2,182
Default RE: DateToWeek function?

Hi guys,

i just saw Delphi6 on a friends job and it seems borland has added a lot of new date functions to Delphi6.

Here's the code to REALLY get the correct weeknumber for any of you interested:

procedure DecodeDateWeek(const AValue: TDateTime; out AYear, AWeekOfYear,
ADayOfWeek: Word);
var
LDayOfYear: Integer;
LMonth, LDay: Word;
LStart: TDateTime;
LStartDayOfWeek, LEndDayOfWeek: Word;
LLeap: Boolean;
begin
LLeap := DecodeDateFully(AValue, AYear, LMonth, LDay, ADayOfWeek);
ADayOfWeek := CDayMap[ADayOfWeek];
LStart := EncodeDate(AYear, 1, 1);
LDayOfYear := Trunc(AValue - LStart + 1);
LStartDayOfWeek := DayOfTheWeek(LStart);
if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then
Dec(LDayOfYear, 8 - LStartDayOfWeek)
else
Inc(LDayOfYear, LStartDayOfWeek - 1);
if LDayOfYear <= 0 then
DecodeDateWeek(LStart - 1, AYear, AWeekOfYear, LDay)
else
begin
AWeekOfYear := LDayOfYear div 7;
if LDayOfYear mod 7 <> 0 then
Inc(AWeekOfYear);
if AWeekOfYear > 52 then
begin
LEndDayOfWeek := LStartDayOfWeek;
if LLeap then
begin
if LEndDayOfWeek = DaySunday then
LEndDayOfWeek := DayMonday
else
Inc(LEndDayOfWeek);
end;
if LEndDayOfWeek in [DayMonday, DayTuesday, DayWednesday] then
begin
Inc(AYear);
AWeekOfYear := 1;
end;
end;
end;
end;


For the REALLY REALLY REALLY interested amongst us:
ALL date/time routines in Delphi6.

CheckSqlTimeStamp procedure

Checks whether a TSQLTimeStamp value represents a valid date and time.

CompareDate function

Indicates the relationship between the date portions of two TDateTime values.

CompareDateTime function

Indicates the relationship between two TDateTime values.

CompareTime function

Indicates the relationship between the time portions of two TDateTime values.

CurrentYear function

Creates a new directory.

Date function

Returns the current date.

DateDelta constant

Specifies the difference between TDateTime and TTimeStamp values.

DateOf function

Strips the time portion from a TDateTime value.

DateTimeToFileDate function

Converts a TDateTime object to an OS timestamp.

DateTimeToSQLTimeStamp function

Converts a TDateTime value to a TSQLTimeStamp value.

DateTimeToStr function

Converts a TDateTime value to a string.

DateTimeToString procedure

Converts a TDateTime value to a string using a specified Format.

DateTimeToSystemTime procedure

Converts a TDateTime value into the Win32 API's TSystemTime type.

DateTimeToTimeStamp function

Converts a TDateTime value into the corresponding TTimeStamp value.

DateToStr function

Converts a TDateTime value to a string.

Day of week constants

Provide symbolic constants for ISO 8601-compliant day of the week values.

DayOf function

Returns the day of the month represented by a TDateTime value.

DayOfTheMonth function

Returns the day of the month represented by a TDateTime value.

DayOfTheWeek function

Returns the day of the week represented by a TDateTime value.

DayOfTheYear function

Returns the number of days between a specified TDateTime value and December 31 of the previous year.

DayOfWeek function

Returns the day of the week for a specified date.

DaysBetween function

Returns the number of whole days between two specified TDateTime values.

DaysInAMonth function

Returns the number of days in a specified month of a specified year.

DaysInAYear function

Returns the number of days in a specified year.

DaysInMonth function

Returns the number of days in the month of a specified TDateTime value.

DaysInYear function

Returns the number of days in the year of a specified TDateTime value.

DaySpan function

Returns the number of days (including fractional days) between two specified TDateTime values.

DecodeDate procedure

Returns Year, Month, and Day values for a TDateTime value.

DecodeDateDay procedure

Returns the year and day of the year for a specified TDateTime value.

DecodeDateFully function

Returns Year, Month, and Day, and Day-of-Week values for a TDateTime value.

DecodeDateMonthWeek procedure

Returns the year, month, week of the month, and day of the week for a specified TDateTime value.

DecodeDateTime procedure

Returns Year, Month, Day, Hour, Minute, Second, and MilliSecond values for a TDateTime value.

DecodeDateWeek procedure

Returns the year, week of the year, and day of the week for a specified TDateTime value.

DecodeDayOfWeekInMonth procedure

For a given TDateTime value, returns the year, month, day of the week, and the count of that day of the week in the month.

DecodeTime procedure

Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.

EncodeDate function; TryEncodeDate function

Returns a TDateTime value that represents a specified Year, Month, and Day.

EncodeDateDay function

Returns a TDateTime value that represents a specified day of the year for a specified year.

EncodeDateMonthWeek function

Returns a TDateTime objectvalue that represents a specified day of a specified week in a specified month and year.

EncodeDateTime function

Returns a TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.

EncodeDateWeek function

Returns a TDateTime value that represents a specified day of a specified week in a specified year.

EncodeDayOfWeekInMonth function

Returns a TDateTime value that represents a specified occurrence of a day of the week within a specified month and year.

EncodeTime function;TryEncodeTime function

Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.

EndOfADay function

Returns a TDateTime value that represents the last millisecond of a specified day.

EndOfAMonth function

Returns a TDateTime value that represents the last millisecond of the last day of a specified month.

EndOfAWeek function

Returns a TDateTime value that represents the last millisecond of a specified day of a specified week.

EndOfAYear function

Returns a TDateTime value that represents the last millisecond of a specified year.

EndOfTheDay function

Returns a TDateTime value that represents the last millisecond of the day identified by a specified TDateTime value.

EndOfTheMonth function

Returns a TDateTime value that represents the last millisecond of the last day of the month identified by a specified TDateTime value.

EndOfTheWeek function

Returns a TDateTime value that represents the last millisecond of the last day of the week identified by a specified TDateTime value.

EndOfTheYear function

Returns a TDateTime value that represents the last millisecond of the last day of the year identified by a specified TDateTime value.

FormatDateTime function

Formats a TDateTime value.

HourOf function

Returns the hour of the day represented by a TDateTime value.

HourOfTheDay function

Returns the hour of the day represented by a TDateTime value.

HourOfTheMonth function

Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the month.

HourOfTheWeek function

Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the week.

HourOfTheYear function

Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the year.

HoursBetween function

Returns the number of whole hours between two specified TDateTime values.

HourSpan function

Returns the number of Hours (including fractional Hours) between two specified TDateTime values.

HoursPerDay constant;MinsPerDay constant;SecsPerDay constant;MSecsPerDay constant

Values useful in time calculations.

IncAMonth procedure

Increments date data by one month.

IncDay function

Returns a date shifted by a specified number of days.

IncHour function

Returns a date/time value shifted by a specified number of hours.

IncMilliSecond function

Returns a date/time value shifted by a specified number of milliseconds.

IncMinute function

Returns a date/time value shifted by a specified number of minutes.

IncMonth function

Returns a date shifted by a specified number of months.

IncSecond function

Returns a date/time value shifted by a specified number of seconds.

IncWeek function

Returns a date shifted by a specified number of weeks.

IncYear function

Returns a date shifted by a specified number of years.

IsInLeapYear function

Indicates whether a specified TDateTime value occurs in a leap year.

IsLeapYear function

Indicates whether a specified year is a leap year.

IsPM function

Indicates whether the time portion of a specified TDateTime value occurs after noon.

IsSameDay function

Indicates whether a specified TDateTime value occurs on a the same day as a criterion date.

IsToday function

Indicates whether a specified TDateTime value occurs on the current date.

IsValidDate function

Indicates whether a specified year, month, and day represent a valid date.

IsValidDateDay function

Indicates whether a specified year and day of the year represent a valid date.

IsValidDateMonthWeek function

Indicates whether a specified year, month, week of the month, and day of the week represent a valid date.

IsValidDateTime function

Indicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.

IsValidDateWeek function

Indicates whether a specified year, week of the year, and day of the week represent a valid date.

IsValidTime function

Indicates whether a specified hour, minute, second, and millisecond represent a valid date and time.

MilliSecondOf function

Returns the millisecond of the second represented by a TDateTime value.

MilliSecondOfTheDay function

Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the same day.

MilliSecondOfTheHour function

Returns the number of milliseconds between a specified TDateTime value and the beginning of the same hour.

MilliSecondOfTheMinute function

Returns the number of milliseconds between a specified TDateTime value and the beginning of the same minute.

MilliSecondOfTheMonth function

Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the first day of the month.

MilliSecondOfTheSecond function

Returns the millisecond of the second represented by a TDateTime value.

MilliSecondOfTheWeek function

Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the first day of the week.

MilliSecondOfTheYear function

Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the first day of the year.

MilliSecondsBetween function

Returns the number of milliseconds between two specified TDateTime values.

MilliSecondSpan function

Returns the number of milliseconds between two specified TDateTime values.

MinuteOf function

Returns the minute of the hour represented by a TDateTime value.

MinuteOfTheDay function

Returns the number of minutes between a specified TDateTime value and 12:00 AM of the same day.

MinuteOfTheHour function

Returns the number of minutes between a specified TDateTime value and the beginning of the same hour.

MinuteOfTheMonth function

Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the month.

MinuteOfTheWeek function

Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the week.

MinuteOfTheYear function

Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the year.

MinutesBetween function

Returns the number of minutes between two specified TDateTime values.

MinuteSpan function

Returns the number of minutes, including fractions thereof, between two specified TDateTime values.

MonthOf function

Returns the month of the year represented by a TDateTime value.

MonthOfTheYear function

Returns the month of the year represented by a TDateTime value.

MonthsBetween function

Returns the approximate number of months between two specified TDateTime values.

MonthSpan function

Returns the approximate number of months (including fractions thereof) between two specified TDateTime values.

MSecsToTimeStamp function

Converts a specified number of milliseconds into a TTimeStamp value.

Now function

Returns the current date and time.

NthDayOfWeek function

Returns which occurence of its weekday a specified TDateTime value represents.

NullSQLTimeStamp constant

Represents a NULL TSQLTimeStamp value.

RecodeDate function

Replaces the date portion of a specified TDateTime value.

RecodeDateTime function

Selectively replaces parts of a specified TDateTime value.

RecodeDay function

Replaces the day of the month for a specified TDateTime value.

RecodeHour function

Replaces the hour of the day for a specified TDateTime value.

RecodeLeaveFieldAsIs constant

Identifies a parameter to RecodeDateTime that should not be used.

RecodeMilliSecond function

Replaces the millisecond of the second for a specified TDateTime value.

RecodeMinute function

Replaces the minute of the hour for a specified TDateTime value.

RecodeMonth function

Replaces the month of the year for a specified TDateTime value.

RecodeSecond function

Replaces the second of the minute for a specified TDateTime value.

RecodeTime function

Replaces the time portion of a specified TDateTime value.

RecodeYear function

Replaces the year for a specified TDateTime value.

ReplaceDate procedure

Replaces the date portion of a TDateTime value with a specified date.

ReplaceTime procedure

Replaces the time portion of a TDateTime value with a specified time.

SameDate function

Indicates whether two TDateTime values represent the same year, month, and day.

SameDateTime function

Indicates whether two TDateTime values represent the same year, month, day, hour, minute, second, and millisecond.

SameTime function

Indicates whether two TDateTime values represent the same time of day, ignoring the date portion.

SecondOf function

Returns the second of the minute represented by a TDateTime value.

SecondOfTheDay function

Returns the number of seconds between a specified TDateTime value and 12:00:00 AM of the same day.

SecondOfTheHour function

Returns the number of seconds between a specified TDateTime value and the beginning of the same hour.

SecondOfTheMinute function

Returns the number of seconds between a specified TDateTime value and the beginning of the same minute.

SecondOfTheMonth function

Returns the number of seconds between a specified TDateTime value and 12:00:00 AM on the first day of the month.

SecondOfTheWeek function

Returns the number of seconds between a specified TDateTime value and 12:00:00 AM of the first day of the week.

SecondOfTheYear function

Returns the number of seconds between a specified TDateTime value and 12:00:00 AM on the first day of the year.

SecondsBetween function

Returns the number of seconds between two specified TDateTime values.

SecondSpan function

Returns the number of seconds (including fractions thereof) between two specified TDateTime values.

SQLDayOfWeek function

Indicates the day of the week when a specified TSQLTimeStamp value occurs.

SQLTimeStampToDateTime function

Converts a TSQLTimeStamp value to a TDateTime value.

SQLTimeStampToStr function

Converts a TSQLTimeStamp value to a string.

StartOfADay function

Returns a TDateTime value that represents 12:00:00:00 AM on a specified day.

StartOfAMonth function

Returns a TDateTime value that represents 12:00:00:00 AM on the first day of a specified month.

StartOfAWeek function

Returns a TDateTime value that represents 12:00:00:00 AM on a specified day of a specified week.

StartOfAYear function

Returns a TDateTime value that represents 12:00:00:00 AM on the first day of a specified year.

StartOfTheDay function

Returns a TDateTime value that represents 12:00:00:00 AM on the day identified by a specified TDateTime value.

StartOfTheMonth function

Returns a TDateTime value that represents 12:00:00:00 AM on the first day of the month identified by a specified TDateTime value.

StartOfTheWeek function

Returns a TDateTime value that represents 12:00:00:00 AM on the first day of the week identified by a specified TDateTime value.

StartOfTheYear function

Returns a TDateTime value that represents 12:00:00:00 AM on the first day of the year identified by a specified TDateTime value.

StrToDate function

Converts a string to a TDateTime value.

StrToDateTime function

Converts a string to a TDateTime value.

StrToSQLTimeStamp function

Converts a string to a TSQLTimeStamp value.

StrToTime function

Converts a string to a TDateTime value.

SystemTimeToDateTime function

Converts a _SYSTEMTIMETSystemTime value into a TDateTime objectvalue.

Time function

Returns the current time.

TimeOf function

Strips the date portion from a TDateTime value.

TimeStampToDateTime function

Converts a TTimeStamp value into the corresponding TDateTime value.

TimeStampToMSecs function

Converts a TTimeStamp value into an absolute number of milliseconds.

TimeToStr function

Returns a string that represents a TDateTime value.

Today function

Returns a TDateTime value that represents the current date.

Tomorrow function

Returns a TDateTime value that represents the following day.

TryEncodeDateDay function

Calculates the TDateTime value that represents a specified day of the year for a specified year.

TryEncodeDateMonthWeek function

Calculates the TDateTime value that represents a specified day of a specified week in a specified month and year.

TryEncodeDateTime function

Calculates the TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.

TryEncodeDateWeek function

Calculates the TDateTime value that represents a specified day of a specified week in a specified year.

TryEncodeDayOfWeekInMonth function

Calculates a TDateTime value that represents a specified occurrence of a day of the week within a specified month and year.

TryRecodeDateTime function

Selectively replaces parts of a specified TDateTime value.

TryStrToSQLTimeStamp function

Converts a string to a TSQLTimeStamp value.

UnixDateDelta constant

Specifies the difference between TDateTime and TIME_T values.

WeekOf function

Returns the week of the year represented by a TDateTime value.

WeekOfTheMonth function

Returns the week of the month represented by a TDateTime value.

WeekOfTheYear function

Returns the week of the year represented by a TDateTime value.

WeeksBetween function

Returns the number of whole weeks between two specified TDateTime values.

WeeksInAYear function

Returns the number of weeks in a specified year.

WeeksInYear function

Returns the number of weeks in the year of a specified TDateTime value.

WeekSpan function

Returns the number of weeks (including fractional weeks) between two specified TDateTime values.

WithinPastDays function

Indicates whether two dates are within a specified number of days of each other.

WithinPastHours function

Indicates whether two date/time values are within a specified number of hours of each other.

WithinPastMilliSeconds function

Indicates whether two date/time values are within a specified number of milliseconds of each other.

WithinPastMinutes function

Indicates whether two date/time values are within a specified number of minutes of each other.

WithinPastMonths function

Indicates whether two date/time values are within a specified number of months of each other.

WithinPastSeconds function

Indicates whether two date/time values are within a specified number of seconds of each other.

WithinPastWeeks function

Indicates whether two date/time values are within a specified number of weeks of each other.

WithinPastYears function

Indicates whether two date/time values are within a specified number of years of each other.

YearOf function

Returns the year represented by a TDateTime value.

YearsBetween function

Returns the approximate number of years between two specified TDateTime values.

YearSpan function

Returns the approximate number of years (including fractions thereof) between two specified TDateTime values.

Yesterday function

Returns a TDateTime value that represents the preceding day.



Greetz,
::TeD On The NeT::

=[ QUESTIONS ]=========================================
don't forget to accept this reply if it helped you!
================================================== =====

=[ EXTRA INFO ]========================================
Location : Netherlands (GMT +01.00)
Languages : English, Dutch, German
Age : 25
ICQ : Be smart and figure out what my UIN is...
================================================== =====
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 06:38 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.