-------- Mensaje original --------
Asunto: Formateo de Fechas
Fecha: Fri, 25 Sep 2009 15:49:07 -0300
De: Ariel Zoia azoia@rec.unicen.edu.ar
A: Pablo Tulipano pablo@unlz.edu.ar
Función para formatear las fechas:
FORMAT (return formatted numbers into a picture)
FORMAT(value,picture)
FORMAT Returns a formatted numeric string.
value A numeric expression for the value to be formatted.
picture A picture token or the label of a CSTRING variable containing
a picture token.
The FORMAT procedure returns a numeric string formatted according to the
picture parameter.
Return Data Type: STRING
Example:
Rpt:SocSecNbr = FORMAT(Emp:SSN,@P###-##-####P)
!Format the soc-sec-nbr
Phone = FORMAT(DEFORMAT(Phone,@P###-###-####P),@P(###)###-####P)
!Change phone format from dashes to parens
DateString = FORMAT(DateLong,@D1) !Format a date as a string
Pictures mas usados para fecha:
Picture Format Result
@D1 mm/dd/yy 10/31/59
@D1>40 mm/dd/yy 10/31/59
@D01 mm/dd/yy 01/01/95
@D2 mm/dd/yyyy 10/31/1959
@D3 mmm dd, yyyy OCT 31,1959
@D4 mmmmmmmmm dd, yyyy October 31, 1959
@D5 dd/mm/yy 31/10/59
@D6 dd/mm/yyyy 31/10/1959
@D7 dd mmm yy 31 OCT 59
@D8 dd mmm yyyy 31 OCT 1959
@D9 yy/mm/dd 59/10/31
@D10 yyyy/mm/dd 1959/10/31
@D11 yymmdd 591031
@D12 yyyymmdd 19591031
@D13 mm/yy 10/59
@D14 mm/yyyy 10/1959
@D15 yy/mm 59/10
@D16 yyyy/mm 1959/10
@D17 Windows Control Panel setting for Short Date
@D18 Windows Control Panel setting for Long Date
Alternate separators
@D1. mm.dd.yy Period separator
@D2- mm-dd-yyyy Dash separator
@D5_ dd mm yy Underscore produces space separator
@D6’ dd,mm,yyyy Grave accent produces comma separator
Saludos,
Ariel Zoia
Equipo SIU-Mapuche/Pampa
Consorcio SIU
02293-422000 int. 131
http://www.siu.edu.ar