Delphi - FORMATO FECHA '01-MAY-07'

 
Vista:

FORMATO FECHA '01-MAY-07'

Publicado por R3DRUM (15 intervenciones) el 13/05/2007 10:30:55
HOLA BUENOS DÍAS:

Os comento, trabajo en Delphi5 con una BD en Oracle. Cuando le mando la fecha, me devuele ERROR por el formato (más bien por el mes).

La fecha la establezco con un DateTimePicker, que admite dos formatos (dfShort, dfLong) que no me valen; y he pensado en asignarselo a una variable y luego a esta variable darle el formato que me pide Oracle '00-MMM-00'.


Entonces pregunto:

¿Como puedo cambiar en Delphi el formato '00-00-00' a '00-MMM-00'?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 65
Oro
Ha mantenido su posición en Delphi (en relación al último mes)
Gráfica de Delphi

RE:FORMATO FECHA '01-MAY-07'

Publicado por E.T. (1244 intervenciones) el 14/05/2007 18:09:07
Algo como esto podría ayudarte, necesitas agregar la unidad "DateUtils" a tu proyecto, con las funciones "DecodeDayOfWeekInMonth" y "DecodeDate"

var AYear, AMonth, ANthDayOfWeek, ADayOfWeek,Year, Month, Day: Word;
begin
FPrincipal.Refresh;
DecodeDayOfWeekInMonth(now,AYear, AMonth, ANthDayOfWeek, ADayOfWeek);
LbFecha.Caption:='Hoy es ';
Case ADayOfWeek of
1:LbFecha.Caption:=LbFecha.Caption+'lunes ';
2:LbFecha.Caption:=LbFecha.Caption+'martes ';
3:LbFecha.Caption:=LbFecha.Caption+'miércoles ';
4:LbFecha.Caption:=LbFecha.Caption+'jueves ';
5:LbFecha.Caption:=LbFecha.Caption+'viernes ';
6:LbFecha.Caption:=LbFecha.Caption+'sábado ';
7:LbFecha.Caption:=LbFecha.Caption+'domingo ';
end;
DecodeDate(Now, Year, Month, Day);
LbFecha.Caption:=LbFecha.Caption+IntToStr(day)+' ';
Case Month of
1:LbFecha.Caption:=LbFecha.Caption+'de enero del ';
2:LbFecha.Caption:=LbFecha.Caption+'de febrero del ';
3:LbFecha.Caption:=LbFecha.Caption+'de marzo del ';
4:LbFecha.Caption:=LbFecha.Caption+'de abril del ';
5:LbFecha.Caption:=LbFecha.Caption+'de mayo del ';
6:LbFecha.Caption:=LbFecha.Caption+'de junio del ';
7:LbFecha.Caption:=LbFecha.Caption+'de julio del ';
8:LbFecha.Caption:=LbFecha.Caption+'de agosto del ';
9:LbFecha.Caption:=LbFecha.Caption+'de septiembre del ';
10:LbFecha.Caption:=LbFecha.Caption+'de octubre del ';
11:LbFecha.Caption:=LbFecha.Caption+'de noviembre del ';
12:LbFecha.Caption:=LbFecha.Caption+'de diciembre del ';
end;
LbFecha.Caption:=LbFecha.Caption+IntToStr(Year);
end;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar