Dec 232017
 
Very nice Date & Time unit for Turbo Pascal, alas TPU for 5.0 only.
File DAT.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Very nice Date & Time unit for Turbo Pascal, alas TPU for 5.0 only.
File Name File Size Zip Size Zip Type
DATETEST.EXE 13536 6760 deflated
DATETEST.PAS 2307 678 deflated
DAT_TIM5.DOC 2628 959 deflated
DAT_TIM5.TPU 11504 4591 deflated

Download File DAT.ZIP Here

Contents of the DAT_TIM5.DOC file


(*
DAT_TIM5.DOC
September 10, 1989

A Turbo Pascal Unit (TPU) for Turbo Pascal 5.0
(Updated from the 11/11/88 TP 4.0 version)

Denam Systems
1115 Madison St. N.E. Suite 226
Salem, Oregon 97303

(503) 363-0198
CompuServe 70405, 1422

Programmer: Dennis R. Fischer

Copyright 1988-89, Denam Systems
FREEWARE - For noncommercial use only



{ Returns system time/date - NO expected input. System
date/time MUST be set correctly prior to using }
procedure GetDateStr (var DateStr : string); { 10/28/88 }
procedure GetDate4Str (var DateStr : string); { 10/28/1988 }
procedure GetFullDateStr (var DateStr : string); { October 28, 1988 }
procedure GetTimeStr (var TimeStr : string); { 1:12 AM }
procedure GetTime24Str (var Time24Str : string); { 0112 }



{ Date string expects either xx/xx/xx or xx/xx/xxxx format. }
function ExtractMonth (Date : string) : word;
function ExtractDay (Date : string) : word;
function ExtractYear (Date : string) : word;


{ Time string MUST be 24 hour format }
function ExtractHour (Time : string) : word;
function ExtractMinute (Time : string) : word;


procedure ConvAMPMTo24 (var Time : string);
{ Converts AM/PM time string to 24 hour string }


procedure Conv24ToAMPM (var Time : string);
{ Converts 24 hour string to AM/PM string }


function IsLeap (Year : word) : boolean;
{ Returns TRUE if year is Leap Year }


function DaysSince0 (Date : string) : longint;
{ Returns the total number of days since January 1, 0000 AD
Expected input is xx/xx/xxxx Minimum beginning date
is January 1, 0001 }


function GetElaspeTime (var TimeStr : string; var TimeVal : longint;
SDate, EDate, STime, ETime : string) : boolean;

{ Expects a date format of xx/xx/xxxx - If a date format of
xx/xx/xx is used, date will default to the 20th century (xx/xx/19xx)

SDate = Starting date
EDate = Ending date
STime = Starting time (24 hour format)
ETime = Ending time (24 hour format)

TimeStr returned = i.e. 2:36 (2 hours & 36 minutes)
TimeVal returned = total minutes

Function returns TRUE if valid date & times were entered else
function returns FALSE and TimeStr contains error message }

*)


 December 23, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)