ESBDates™ - Date/Time Routine Collection v1.8.1 - 24 October 1999 by ESB Consultancy (Glenn Crouch) mailto:info@esbconsult.com.au (c) 1999 ESB Consultancy PO Box 2259 Boulder WA 6432 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 175 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.pip.dknet.dk/~c-t/calendar.html Some of our algorithms are based on info from the above. The document Calendar20.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 3, 4 and 5 checked but should also work fine in Delphi 2. 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 A Mailing List to notify of updates and ask questions is available at the website. 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án Montañez Wolfgang Wendefeuer Gary Mugford David Gobbett Niklas Astrom Laurent Pierre Chris Means Primoz Gabrijelcic Many thanks to you all :) --- What's Still to Come: This list can be changed depending on the requests we receive from users and our own internal needs. Currently we still plan to add the following: - Financial Year Routines - ISO-8601 Ordered Date Routines - ISO-8601 Time Formatting Routines - ISO-8601 Strings to Date - ISO-8601 Strings to Time - ISO-8601 Strings to Date/Time - ISO-8601 Periods Routines - Some basic Astronomical Routines For Date and Time Edit Components check out our ESB Professional Computation Suite (ESBPCS) - trial versions available soon. Check out the website at http://www.esbpcs.com --- Version History: 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án Montañez 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 Other Products ============== ESBPDF™ Analysis ================ Provides everything needed for using Discrete & Continuous Probability Distributions in a single application. Most Tables and supplied functions (such as in MS Excel) give P(X <= A) and using algebra other results can be found whereas ESB PDF Analysis handles all the Probability combinations for you. Features include: Binomial, Poisson, Normal, Exponential, Student t, Chi Squared and F Distributions; Inverses of the Normal, Student t, Chi Squared and F Distributions; Lists of Binomial Coefficients, Factorials, Permutations; Fully Customisable; Integrated Help System which includes a Tutorial. We also plan on adding many more Distributions and features. Ideal for the Maths/Stats Student who wishes to understand Probability Distributions better, as well as the Maths Buff who wants a well designed calculating tool. Fully Functional Trial version available from our web site. ESBStats™ ========= Statistical Analysis & Inferences in a MS Office 97 style Environment. - Single, Dual (paired and unpaired) and Multiple Data Analysis. - Data can be either for Sample or Population - Data can be Time Based - Data can be entered as Raw Data; Grouped Data; or as Summary Data - Raw Data can be converted into Grouped Data - Raw Data can have in-built Transformations applied to them - Raw Data can have Custom defined Transformations applied to them - Raw Data can have Random values meeting user defined criteria - Data can be fully documented and stored in DataLists - Standardisation of Data around given mean/standard deviation - DataLists are grouped together in Workbooks - one Workbook is opened at a time and can contain many DataLists - ESB Statistical Workbooks (.esw) are Compound Documents like MS Word Documents and MS Excel Spreadsheets, thus they support the same properties in Explorer. - Sample Size calculations - Random Sampling Lists - Statistical Summary including: mean, median, mode, variance, standard deviation, kurtosis, skew, etc. - Comparison of Statistics for Raw and Grouped of the same Data. - Graphs and Charts including: Histograms, Line Graphs, Pie Graphs, Ogives, Scatter Diagrams, etc - Inference and Hypothesis Analysis of a Single Population - including the Mean, the Variance and Proportions. - Inference and Hypothesis Analysis of Two Populations - including Difference of the Mean, Ratio of the Variance, Difference of Proportions. - Analysis of Variance (ANOVA) - Analysis of Contingency Tables - Nonparametric Statistics such as Wilcoxon Rank Sum Test - Linear Regression with Transformations of the dependent variable - Multiple Regression with Transformations of the dependent variables - Custom defined Transformations for Dual Data and Multiple Data Analysis - Moving Averages - Trend Analysis of Time Series Data - Curve Fitting - calculation of polynomials and splines - Data Import and Export to Text, Comma Delimited and Tab Delimited - Data Import and Export to Excel - Data Import and Export to DBF - Data Import and Export to WKS - Data Input and Export via ODBC to Databases such as MS Access, SQL Server and Oracle - Saving of Charts and Graphs to BMP, WMF, EMF and JPG - Saving of Summaries to RTF - Sophisticated Reporting with Previewing - HTML Output for integration into your Website - Integrated Scientific Calculator also available as standalone - Documentation Fields include Live Spell Checking like in MS Word - Spell Checking and Thesaurus available on all Edit Fields - Fully customisable interface - Fully Integrated Help System - On-line Tutorial Available in 3 Editions: Lite, Standard and Professional ESBPCS™ ======= A powerful suite of routines and components to aid in Data Entry and Computation. Areas covered include Date & Time Manipulation, Complex Numbers, Fractions, Statistics, Linear Regression, Trigonometry, Geometry, Unit Conversions, Vectors, Matrices, Strings, and much more. ESBCalc™ ======== A powerful FREEWARE Scientific Calculator, that uses Infix notation and supports many functions. ESBCalc™ is integrated into ESBPDF™ and ESBStats™ but if you would like a Free Standalone version come to our web site and grab this. Includes Delphi 4 Source. LMD Tools (http://www.lmdtools.com) needed to recompile. ESBRoutines™ ============ Collection of misc Delphi 32 Routines covering Strings, Block Manipulation, Conversions, Bit Lists and more. Freeware. Includes full Source and Help File. ESBMaths™ ========= Collection of Maths and Stats Routines for Delphi 32. Includes a unit for manipulation of Delphi 4 Dynamic Arrays (i.e. Vectors). Freeware. Includes full Source and Help File. --- ESB Consultancy mailto:info@esbconsult.com.au http://www.esbconsult.com.au