GetESBDateOrder Function
Identifies which of the three common formats for Date Order that a given Date Format is in.

Unit
QESBPCSDateTime

Declaration
Function GetESBDateOrder(const DateFormat: string): TESBDateOrder;

Description
edoDMY - Day/Month/Year

edoMDY - Month/Day/Year

edoYD - Year/Month/Day

Parameters
DateFormat that the Date is assumed to be in, eg 'DD/MM/YY'.

Category
Date/Time Conversion Routines

Implementation

function GetESBDateOrder (const DateFormat: string): TESBDateOrder;
var
     I, Len: LongWord;
     Ch: Char;
begin
     Result := edoDMY;
     Len := Length (DateFormat);
     for I := 1 to Len do
     begin
          Ch := Upcase (DateFormat [I]);
          if Ch in ['D', 'E', 'M', 'Y'] then
          begin
               case Ch of
                    'D': Result := edoDMY;
                    'E': Result := edoYMD;
                    'M': Result := edoMDY;
                    'Y': Result := edoYMD;
               else
                    Result := edoUnknown;
               end;
               Break;
          end;
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com