www.gusucode.com > 收集一些Delphi时间处理函数源码程序 > 收集一些Delphi时间处理函数/ESBDates/ESBDates/ESBDates.txt

    ESBDates(TM) - Date/Time Routine Collection v3.0.1 - 7 September 2001

by ESB Consultancy (Glenn Crouch) mailto:info@esbconsult.com.au

(c)1999-2001 ESB Consultancy
PO Box 2259
Boulder WA 6449
AUSTRALIA
http://www.esbconsult.com.au/

The aim of this code is to provide extra Date/Time routines to those supplied
with SysUtils, covering Date Conversions, Time Conversions, Date Arithmetic,
Easter Calculations, Time Zones, RFC822 Compliant Routines, ISO-8601 Compliant
Routines, Week Numbers, and much more. We now have over 200 Routines thanks
to user feedback!

"ISO-8601:1988 Data elements and interchange formats - information
interchange - Representation of dates and times". Routines based on
this is now mostly done for Dates, especially Weeks.

Grab the above Document as a PDF File from:
http://www.iso.ch/markete/8601.pdf

"RFC822: STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES". Routines
based on this for Time Zone Formatting are included.

Grab the above Document as a Text File from:
http://info.internet.isi.edu/in-notes/rfc/files/rfc822.txt

Recommend checking out (included):

FREQUENTLY ASKED QUESTIONS ABOUT CALENDARS
http://www.tondering.dk/claus/calendar.html
 
Some of our algorithms are based on info from the above.

The document Calendar23.txt has been included with permission
from the author.

---
GpTimeZone Routines are included with the support and permission of
Primoz Gabrijelcic.
mailto:primoz.gabrijelcic@altavista.net
http://www.eccentrica.org/gabr
http://members.xoom.com/primozg

---

Code is Delphi 4, 5 and 6 checked but should also work fine in Delphi 2 & 3
as well as C++ Builder 4 & 5.

The Help File has been produced with a pre-release Time2Help,
so this is still a work in progress. I recommened that you
check out this tool at: http://www.time2help.com

You are free to use the code as you see fit, however an
Email or Postcard would be nice, as would a reference to
our web site included on our web site or in your docs.
Though none of this is obligatory.

ESB Consultancy makes no guarantees regarding the capabilities
nor the "Safeness" of this code. It is free after all,
so you take all the risks :-)

ESB Consultancy makes no promise of support for this code,
however we are happy to receive Email comments

There is a support Conference available at:
http://e-fora.net:8080/~ESB

This allows access via Web Board, Mailing List and/or News Reader.
If you have trouble accessing, then email us and we will happily
add you to Mailing List Access.

Latest version always at http://www.esbconsult.com.au/

---

WARNING - CHANGING TIME ZONE INFO

Some routines included allow you to change the Regional Settings and in
particular, the Time Zone Information. BE VERY CAREFUL when using these
routines. Use the routines that "Get" the Information so that you can store
that to reset the values. You can seriously mess up your compute with these
routines!

If messed up go to Control Panel Date/Time Applet, choose another Time
Zone, Apply it, change back to your Time Zone, Apply it, fix the date/time,
and apply it.

If in doubt, don't use these routines!!!

People who have helped out with ESBDates via good suggestions and/or
code snippets:

	Scott Kane
	Peter Ogden
	Dr John Stockton
	John Atchison
	Marcos Guzm醤 Monta馿z
	Wolfgang Wendefeuer
	Gary Mugford
	David Gobbett
	Niklas Astrom
	Laurent Pierre
	Chris Means
	Primoz Gabrijelcic
	J. Peter Mugaas
	Damien Racca
	Wolfgang Werner
	Mark Lussier
	Ken Otto
	Joel Joly
	Tom Grieve

Many thanks to you all :)

---

For Date and Time Edit Components, Calendar Components, Time Zone Components
and even more routines check out our ESB Professional Computation
Suite (ESBPCS) - trial versions, demos & screenshots available.
Check out the website at http://www.esbconsult.com.au/esbpcs2

---

Other Products - see esbproducts.pdf

---
Version History:

v3.0.1 7-Sep-2001
- Add GpTimeZone v1.21
- Improved D2 support

v3.0.0 6-Sep-2001
- Testing is only done for Delphi 4 and above from here on in.
- Delphi 6 Support added.
- Heaps more constants added.
- Optimised Encoding and Decoding of Dates.
- ResourceStrings now used.
- Date formatted as an MS Access Style Comparison Added.
- Date formatted as an ANSI SQL Style Comparison Added.
- Heaps of Date and Time Conversion Routines added.
- Added an Enhanced Str2Date Conversion.
- Add GpTimeZone v1.2

v2.2.0 3-Feb-2001
- Fixed bug with IsAugustNow

v2.1.0 8-Oct-2000
- Add GpTimeZone v1.1b
- Add Calendar FAQ v2.3
- Added Calendar Weeks Apart
- Added Calendar Months Apart
- Added IsValidLongMonth & IsValidShortMonth Routines
- Added IsValidLongDOW & IsValidShortDOW Routines
- Added IsFirstDayOfMonth, IsLastDayofMonth Comparisons
- Added IsFirstDayOfYear, IsLastDayofYear Comparisons
- Added ISODateTime2DateTime as suggested by Wolfgang Werner.
- Fixed TimeApartInSecs - thanks to Mark Lussier.

v2.0.0 17-Feb-2000
- Add GpTimeZone v1.1
- Added TFileTime / TDateTime Conversions donated by J Peter Mugaas
- Added DateTimeToLargeInteger donated by Damien Racca
- Added DT Constants
- Added TimeApartInXXX routines
- Added SameDate, SameTime, SameDateTime
- DOW2Int & Month2Int relpaced by DayName2DOW & MonthName2Month
- Date to Short Month, Long Month, Short DOW, Long DOW Routines added
- Added GMTNow, GMTDate, GMTTime to return the current Date/Time info at
  GMT/UTC.
- Redesigned Help

v1.8.2 5-Nov-99
- Calender21.txt included
- URL's updated

v1.8.1 24-0ct-99
- Add GpTimeZone v1.0.1
- GpTimeZone Demo Project now works with Delphi 3

v1.8 18-Oct-99
- Removed Daylight Savings Routines due to bugs and included new unit
	GpTimeZone from Primoz Gabrijelcic. Many thanks also to Chris Means
	for his identification of problems with our routine.

v1.7 6-September-99
- D5 Compatibility added
- Updated Str2Time
- Redesigned Str2Date - previous version didn't work with all DateFormats
- Added Elapsing Time Routine donated by Laurent PIERRE

v1.6 1-August-99
- Str2Date now allows year to be omitted - assumes current year
- Str2Date now allows you to decide how 2 Digit Years are to be processed
- Str2HistoricDate assumes 2 Digit Years are this year or earlier
- Str2CutoffDate uses a Cutoff Date to control how 2 Digit Years are
processed
- Date2Str more tolerant of returning an empty string
- Fixed Problem with AddMonths with Negative Months
- Fixed bug in GetFirstSundayOfYear
- Age in Months & Weeks Routines donated by David Gobbett - aimed at
  Hospital Application
- Added Various ISO-8601 Compliant Week and Formatting routines - thanks
  to Niklas Astrom
- Links to ISO-8601 and RFC-822 added

v1.5 12-July-99
- Now over 150 Routines
- Added Subtraction routines for completeness
- AgeAtDate and AgeNow Routines added
- Fixed a number of mistakes in the comments
- Conversion of English Day of Week Description to Integer
- Conversion of English Month Description to Integer
- WeeksApart (Integer) and ExactWeeksApart (Float) added
- Added GetFirstSundayOfYear
- Added Week Number processing

v1.4.1 18-June-99
- Fixed Bug in ConvertRFC822Times

v1.4 21-May-1999
- Now have over 125 Routines!
- Added AddDays (though this is simple Addition) for completion
- Added Heaps of new Date/Time Arithmetic Routines.
  Many suggested by John Atchison [jatchison@msn.com]
- Added Heaps of Boolean Routines like IsJanuary, IsMonday, etc.
  Many suggested by John Atchison [jatchison@msn.com]
- Added Seconds (Floating) to a string of days, hours, minutes, seconds.
  Routine donated by: Marcos Guzm醤 Monta馿z marcos.guzman@eds.com

1.3 27-Apr-1999
- Added TimeZone constants missing from D3 (but in D4 Windows.pas)
- Added StartofWeek which returns the Start of the week a date is in, i.e. the Sunday
- Added Routine to set Local Time Bias - see warning above
- Added Routine to return Daylight Savings Info
- Added Routine to return set Daylight Savings Info - see warning above
- Added Routines to return current Details - ThisYear, ThisMonth, ThisDay,
  ThisHr, ThisMin, ThisSec, ThisMSec

1.2 19-Apr-1999
- Added RFC822 Time Zone Routines
- Fixed problem with Str2Ext

1.1 6-Apr-1999
- Added Better IsLeapYear
- Added GetFirstDayOfMonth & GetLastDayOfMonth
- Added Constants for Tropical Year and Synodic Month
- Added Calculation of GoldenNumber and Epact for given year
- Added GetGoodFriday and GetEasterSunday for given year
- Added GMTStr2Value
- Added GetLocalTZBias - which allows for Daylight Savings settings
- Added GetLocalTime - turns GMT into Local via Regional Settings
- All Local Time Zone routines handle Standard/Daylight Biases
- Added ConvertGMTStrTimes to convert between two GMT related Date/Times

1.0 6 March 1999 Initial Release

---
ESB Consultancy mailto:info@esbconsult.com.au
http://www.esbconsult.com.au