Date2StarSign Function
Returns the Star Sign (Astrology) for the Given Date.

Unit
QESBPCSDateTime

Declaration
Function Date2StarSign(const DT: TDateTime): string;

Description
Values obtained from ESBStarSigns. Thanks to Tom Grieve for this routine.

Category
Date/Time Conversion Routines

Implementation

function Date2StarSign (const DT: TDateTime): string;
var
     Year, Month, Day: Integer;
     Ofs: Integer;
begin
     OptDecodeDateI (DT, Year, Month, Day);
     case Month * 100 + Day of
          0101..0119: Ofs := 12; // Capricorn
          0120..0218: Ofs := 1; // Aquarius
          0219..0320: Ofs := 2; // Pisces
          0321..0419: Ofs := 3; // Aries
          0420..0520: Ofs := 4; // Taurus
          0521..0621: Ofs := 5; // Gemini
          0622..0722: Ofs := 6; // Cancer
          0723..0822: Ofs := 7; // Leo
          0823..0922: Ofs := 8; // Virgo
          0923..1022: Ofs := 9; // Libra
          1023..1121: Ofs := 10; // Scorpio
          1122..1221: Ofs := 11; // Sagittarius
          1222..1231: Ofs := 12; // Capricorn
     else
          Ofs := 0;
     end;

     if Ofs in [1..12] then
          Result := ESBStarSigns [Ofs]
     else
          Result := '';
End;


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