I sent a lot of time over a number of years writing then modify a time date
object to make conversions etc simpler. With the code completion in delphi
it meant that i did not have to remember the name of all the different
conversion routines - and add my own for the food industry where the date is
encoded to obscure the year and month.
 
Maurice
This is a sample:
 
  EDateTimeException = class(exception);
 
  tJulianDateTime = class(TPersistent)
  private
    MyDateTime : tDateTime;
    bMyDateTimeValid : boolean;
  protected
    function getDateTime: tDateTime;
    procedure setDateTime (DateTime:tdateTime);
    function getJulianValue: integer;
    function getDayOfYear : integer;
    function getMediumDateString:string;
    procedure setMediumDateString(aDateString:string);
    procedure setMediumDateTimeString(aDateTimeString : String);
    function getMediumDateTimeString:string;
  public
    constructor Create; virtual;
    property AsDateTime : TDateTime read getDateTime write setDateTime;
    function AsString(DateTimeFormatString:string):string;
    function IsLeapYear : boolean;
    property AsJulianValue : integer read getJulianValue;
    property AsDayOfYear : integer read getDayOfYear;
    property AsMediumDateString :string read getMediumDateString write
setMediumDateString;
    property AsMediumDateTimeString : string read getMediumDateTimeString
write setMediumDateTimeString;
    function AsDayOfWeek: integer;
    function AsShortDayOfWeek : string;
    function AsLongDayOfWeek : string;
    procedure IncDay;
    function Year : integer;
    function Month : integer;
    function Day   : integer;
    function Hour  : integer;
    function Minute : integer;
    function Second : integer;
etc;

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of David O'Brien
Sent: Friday, 18 June 2004 12:08 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Date conversions



Hi all,

 

Is there any easy way of converting a date string into a TDate?

 

i.e. "Fri, 18 Jun, 2004"

 

Dave.

<<attachment: winmail.dat>>

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to