Ver Mensaje Individual
  #6  
Antiguo 24-05-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Cool Solucion

Tengo entendido que el meollo del asunto está en los nombres de los días y los meses... Siendo éste el caso divagué entre APIs y la unidad SysUtils para producir tu resultado, espero sea lo que necesitas.

Código Delphi [-]
function GetLocaleStr(const Locale, LCType: Cardinal): ShortString;
begin
 Result[0] := Char(GetLocaleInfo(Locale, LCType, @Result[1], 255) - 1);
 Result[1] := Char(Byte(Result[1]) and not $20);
end;

function GetDateStr(DateTime: TDateTime; Lang: Cardinal): string;
var SystemTime: TSystemTime; Locale, LCID: Cardinal;
begin
 LCID := GetThreadLocale;
 SetThreadLocale(Lang);
 Locale := GetThreadLocale;
 DateTimeToSystemTime(DateTime, SystemTime);
 Result := GetLocaleStr(Locale, LOCALE_SDAYNAME1 + Word(SystemTime.wDayOfWeek - 1) mod $FFF9) + ', ' + IntToStr(SystemTime.wDay) + ' de ' +
           GetLocaleStr(Locale, LOCALE_SMONTHNAME1 + SystemTime.wMonth - 1) + ' del ' + IntToStr(SystemTime.wYear);
 SetThreadLocale(LCID);
end;
 
procedure TForm1.FormCreate(Sender: TObject);
var xxx: string;
begin
 DateTimeToString(xxx, 'dddd, d "de" mmmm "de" yyyy', Now);
 Caption := xxx + ' ~ ' + GetDateStr(Now, LANG_PORTUGUESE) + ' ~ ' + GetDateStr(Now, LANG_ENGLISH) + ' ~ ' + GetDateStr(Now, LANG_SPANISH);
end;

Saludos

Última edición por cHackAll fecha: 24-05-2007 a las 19:07:27.
Responder Con Cita