home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / DATIM5.ZIP / DA_TI51.DOC next >
Encoding:
Text File  |  1989-09-14  |  2.7 KB  |  82 lines

  1. (*
  2.                        DA_TI51.DOC
  3.                      September 14, 1989
  4.  
  5.        A Turbo Pascal Unit (TPU) for Turbo Pascal 5.0
  6.           (Updated from the 11/11/88 TP 4.0 version)
  7.  
  8.           Updated again !! Fix GetElaspeTime problem.
  9.        DAT_TIM5.TPU was in error. Renamed to DA_TI51.TPU
  10.  
  11.                        Denam Systems
  12.              1115 Madison St. N.E.  Suite 226
  13.                    Salem, Oregon  97303
  14.  
  15.                       (503) 363-0198
  16.                   CompuServe 70405, 1422
  17.  
  18.                 Programmer: Dennis R. Fischer
  19.  
  20.                Copyright 1988-89, Denam Systems
  21.              FREEWARE - For noncommercial use only
  22.  
  23.  
  24.  
  25.    { Returns system time/date - NO expected input. System
  26.      date/time MUST be set correctly prior to using }
  27.    procedure GetDateStr     (var DateStr : string);    { 10/28/88 }
  28.    procedure GetDate4Str    (var DateStr : string);    { 10/28/1988 }
  29.    procedure GetFullDateStr (var DateStr : string);    { October 28, 1988 }
  30.    procedure GetTimeStr     (var TimeStr : string);    { 1:12 AM }
  31.    procedure GetTime24Str   (var Time24Str : string);  { 0112 }
  32.  
  33.  
  34.    { Date string expects either mm/dd/yy or mm/dd/yyyy format. }
  35.    function  ExtractMonth   (Date : string) : word;
  36.    function  ExtractDay     (Date : string) : word;
  37.    function  ExtractYear    (Date : string) : word;
  38.  
  39.  
  40.    { Time string MUST be 24 hour format }
  41.    function  ExtractHour    (Time : string) : word;
  42.    function  ExtractMinute  (Time : string) : word;
  43.  
  44.  
  45.    procedure ConvAMPMTo24   (var Time : string);
  46.    { Converts AM/PM time string to 24 hour string }
  47.  
  48.  
  49.    procedure Conv24ToAMPM   (var Time : string);
  50.    { Converts 24 hour string to AM/PM string }
  51.  
  52.  
  53.    function  IsLeap         (Year : word) : boolean;
  54.    { Returns TRUE if year is Leap Year }
  55.  
  56.  
  57.    function  DaysSince0     (Date : string) : longint;
  58.    { Returns the total number of days since January 1, 0000 AD
  59.      Expected input is mm/dd/yyyy  Minimum beginning date
  60.      is January 1, 0001 }
  61.  
  62.  
  63.    function  GetElaspeTime  (var TimeStr : string; var TimeVal : longint;
  64.                              SDate, EDate, STime, ETime : string) : boolean;
  65.  
  66.    {   Expects a date format of mm/dd/yyyy - If a date format of
  67.        mm/dd/yy is used, GetElaspeTime will default to the
  68.        20th century (i.e. mm/dd/19yy)
  69.  
  70.        SDate = Starting date
  71.        EDate = Ending date
  72.        STime = Starting time (24 hour format)
  73.        ETime = Ending time (24 hour format)
  74.  
  75.        TimeStr returned = i.e. 2:36 (2 hours & 36 minutes)
  76.        TimeVal returned = total minutes
  77.  
  78.        Function returns TRUE if valid date & times were entered else
  79.        function returns FALSE and TimeStr contains a limited error
  80.        message }
  81.  
  82. *)