Unit JDates

Classes

Functions

BumpDate - Convert from a date to day,month,year

Convert from a date to day,month,year
CurrentJDate - replacement for old WINDOS proc
DateToDMY - Convert from day,month,year to a date

Convert from day,month,year to a date } { Stored as number of days since January 1, 1900 } { Note that no error checking takes place in this routine -- use ValidDate
DateToStr - Return a string version of a month

Return a string version of a month
DayOfWeek - Add (or subtract) the number of days, months, and years to a date

Add (or subtract) the number of days, months, and years to a date } { Note that months and years are added first before days } { Note further that there are no overflow/underflow checks
DayOfYear - -Return the week-of-year from a julian date.
DaysInMonth - -Return the current day of year assuming Jan 1 is day 1

12/31/Year-1
DayString - Return the day of the week for the date

Return the day of the week for the date
DMYtoDate - Check if the day,month,year is a real date storable in a Date variable

(Day<1) or
GetDate - -Return the number of days in any given Month and Year
GetTime - replacement for old WINDOS proc
MonthString - Return a string version of a day of the week

Return a string version of a day of the week
StrToDate - Convert a date to a sortable string

Convert a date to a sortable string - NOT displayable
ValidDate -
WeekOfYear - Convert a sortable string form to a date

Written 94/10/05, Kim Kokkonen, TurboPower Software Modified 01/19/96, Dennis Passmore for use with JDATES.

Types

TDate
TDay
TDaySet

Constants

BlankDate
MaxDate
MinDate

Variables


Functions


function BumpDate(Julian: TDate;Days,Months,Years: Integer): TDate;

Convert from a date to day,month,year

Convert from a date to day,month,year


function CurrentJDate: Tdate;

replacement for old WINDOS proc

procedure DateToDMY(Julian: TDate;var Day,Month,Year: Word);

Convert from day,month,year to a date

Convert from day,month,year to a date } { Stored as number of days since January 1, 1900 } { Note that no error checking takes place in this routine -- use ValidDate


function DateToStr(Julian: TDate): string;

Return a string version of a month

Return a string version of a month


function DayOfWeek(Julian: TDate): TDay;

Add (or subtract) the number of days, months, and years to a date

Add (or subtract) the number of days, months, and years to a date } { Note that months and years are added first before days } { Note further that there are no overflow/underflow checks


function DayOfYear(Julian : TDate) : Integer;

-Return the week-of-year from a julian date. As defined here, the week always starts on a Sunday. Week 1 starts on the first Sunday of the year. Returns 0 for days earlier than that, and -1 for invalid dates.

Compute FirstJulian, the julian date for the first Sunday in the year


function DaysInMonth(MonthNumber, YearofMonth: Integer): Word;

-Return the current day of year assuming Jan 1 is day 1

12/31/Year-1


function DayString(WeekDay: TDay): string;

Return the day of the week for the date

Return the day of the week for the date


procedure DMYtoDate(Day,Month,Year: Word;var Julian: TDate);

Check if the day,month,year is a real date storable in a Date variable

(Day<1) or


procedure GetDate(var Year,Month,Day,Wday: Word);

-Return the number of days in any given Month and Year

procedure GetTime(var Hour,Min,Sec,MSec: Word);

replacement for old WINDOS proc

function MonthString(Month: Word): string;

Return a string version of a day of the week

Return a string version of a day of the week


function StrToDate(StrVar: string): TDate;

Convert a date to a sortable string

Convert a date to a sortable string - NOT displayable


function ValidDate(Day,Month,Year: Word): boolean;


function WeekOfYear(Julian : TDate) : Integer;

Convert a sortable string form to a date

Written 94/10/05, Kim Kokkonen, TurboPower Software Modified 01/19/96, Dennis Passmore for use with JDATES.PAS


Types


TDate = Word

TDay = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday);

TDaySet = set of TDay

Constants

BlankDate = $FFFF

A unit providing Julian day numbers and date manipulations. NOTE: The range of Dates this unit will handle is 1/1/1900 to 1/1/2078 Version 1.00 - 10/26/1987 - First general release Scott Bussinger Professional Practice Systems 110 South 131st Street Tacoma, WA 98444 (206)531-8944 Compuserve 72247,2671 Version 1.01 - 10/09/1995 - Updated for use with Delphi v1.0 Lets see some other code last this long without change Version 1.02 - 01/19/1996 - Added function WeekOfYear() as written 10/05/1994 by Kim Kokkonen, TurboPower Software - Added function DayOfYear() 02/04/1996 - Added DaysInMonth() Dennis Passmore 1929 Mango Tree Drive Edgewater Fl, 32141 Compuserve 71240,2464

MaxDate = $FF62

MinDate = $0000

Constant for Not-a-real-Date

Variables