[Cascavel-pm] OFF- DUVIDA data do TimeStamp
Patty Silva
ptfzs em yahoo.com.br
Quarta Maio 17 04:48:43 PDT 2006
Obrigada Nelson"" :)
Nelson Ferraz <nferraz em gmail.com> escreveu: Patty Silva wrote:
> Pessoal, extrai a data usando o MYSQL UNIX_TIMESTAMP(), como eu faco
> para visualizar qual data corresponde a essa saida
> ex: ele me gera assim: 1142996400 , quero vizualizar essa data no
> formato yyyy-mm-dd hh ;) tem como?
Procurando no Google:
http://www.google.com/search?q=mysql+unix_timestamp
Primeiro resultado:
FROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)
Returns a representation of the unix_timestamp argument as a value in
'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the
function is used in a string or numeric context. unix_timestamp is an
internal timestamp value such as is produced by the UNIX_TIMESTAMP()
function.
If format is given, the result is formatted according to the format
string, which is used the same way as listed in the entry for the
DATE_FORMAT() function.
mysql> SELECT FROM_UNIXTIME(875996580);
-> '1997-10-04 22:23:00'
mysql> SELECT FROM_UNIXTIME(875996580) + 0;
-> 19971004222300
mysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),
-> '%Y %D %M %h:%i:%s %x');
-> '2003 6th August 06:22:58 2003'
Note: If you use UNIX_TIMESTAMP() and FROM_UNIXTIME() to convert between
TIMESTAMP values and Unix timestamp values, the conversion is lossy
because the mapping is not one-to-one in both directions. For details,
see the description of the UNIX_TIMESTAMP() function.
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
_______________________________________________
Cascavel-pm mailing list
Cascavel-pm em pm.org
http://mail.pm.org/mailman/listinfo/cascavel-pm
---------------------------------
Abra sua conta no Yahoo! Mail - 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz.
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://mail.pm.org/pipermail/cascavel-pm/attachments/20060517/63111781/attachment.html
Mais detalhes sobre a lista de discussão Cascavel-pm