Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/06/2002, 05:12
comun
 
Fecha de Ingreso: enero-2002
Mensajes: 132
Antigüedad: 22 años, 3 meses
Puntos: 1
Re: formato de fechas php(sqlServer)

Hola,

prueba a poner esto....

echo date('d - m - y',odbc_result($queryC,1));

Comprueba que $queryC,1 sea el campo fecha...

... si sigue sin salirte aquí te pongo un poco de información sobre el formateo de fechas en mysql...




Funcion DATE_FORMAT de MYsql es...

DATE_FORMAT(date,format)
Formats the date value according to the format string. The following
specifiers may be used in the format string:
%M Month name (January..December)
%W Weekday name (Sunday..Saturday)
%D Day of the month with English suffix (1st, 2nd, 3rd, etc.)
%Y Year, numeric, 4 digits
%y Year, numeric, 2 digits
%X Year for the week where Sunday is the first day of the week, numeric,
4 digits, used with '%V'
%x Year for the week, where Monday is the first day of the week, numeric,
4 digits, used with '%v'
%a Abbreviated weekday name (Sun..Sat)
%d Day of the month, numeric (00..31)
%e Day of the month, numeric (0..31)
%m Month, numeric (01..12)
%c Month, numeric (1..12)
%b Abbreviated month name (Jan..Dec)
%j Day of year (001..366)
%H Hour (00..23)
%k Hour (0..23)
%h Hour (01..12)
%I Hour (01..12)
%l Hour (1..12)
%i Minutes, numeric (00..59)
%r Time, 12-hour (hh:mm:ss [AP]M)
%T Time, 24-hour (hh:mm:ss)
%S Seconds (00..59)
%s Seconds (00..59)
%p AM or PM
%w Day of the week (0=Sunday..6=Saturday)
%U Week (0..53), where Sunday is the first day of the week
%u Week (0..53), where Monday is the first day of the week
%V Week (1..53), where Sunday is the first day of the week. Used with
'%X'
%v Week (1..53), where Monday is the first day of the week. Used with
'%x'
%% A literal `%'.


Ejemplo....

SELECT date_format(lastaccesstime, '%M %e, %Y') FROM user WHERE userid =
'hecky';

.




Un saludo, esperando ser de ayuda...
COMUN

<a href='ir.asp?http://www.califato.com' target='_blank'>http://www.califato.com...</a>
<a href='ir.asp?http://www.califato.net' target='_blank'>http://www.califato.net...</a>

<center>
<img src="http://membres.lycos.fr/dipro/new/logo.gif" border=0 width="100" height="30">
<a href='ir.asp?http://dipro.califato.com' target='_blank'>http://dipro.califato.com...</a>
</