subkiller Posted June 18, 2009 at 03:52 PM Report Share #273388 Posted June 18, 2009 at 03:52 PM boas de que tipo tem de ser um campo da base de dados para guardar uma hora no formato: ano-mes-dia hora-minuto-segundo e ha alguma funçao do php que me retorne a hora do moemnto com o mesmo formato? cumps. Link to comment Share on other sites More sharing options...
fnds Posted June 18, 2009 at 04:03 PM Report Share #273392 Posted June 18, 2009 at 04:03 PM O que eu fazia era guardar o timestamp num campo int (acho que cabe) e depois formatares isso como quiseres, está aqui um exemplo muito bom http://pt2.php.net/time . Link to comment Share on other sites More sharing options...
subkiller Posted June 18, 2009 at 04:08 PM Author Report Share #273393 Posted June 18, 2009 at 04:08 PM obrigado pela respota fnds era exactamente algo desse genero que eu queria.... 😛 mas nao posso guardar na bd como timestamp ou datetime? Link to comment Share on other sites More sharing options...
falco Posted June 18, 2009 at 04:10 PM Report Share #273394 Posted June 18, 2009 at 04:10 PM Existem tipoos específicos para isso nos SGDB... Por exemplo em Mysql tens: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.html Link to comment Share on other sites More sharing options...
subkiller Posted June 18, 2009 at 04:18 PM Author Report Share #273395 Posted June 18, 2009 at 04:18 PM um datetime serve perfeitamente... obrigado pelas respostas... 😛 Link to comment Share on other sites More sharing options...
fnds Posted June 18, 2009 at 04:19 PM Report Share #273396 Posted June 18, 2009 at 04:19 PM Sempre ás ordens, para estar perfeito só faltava colocares o tópico como resolvido 😛 Link to comment Share on other sites More sharing options...
subkiller Posted June 18, 2009 at 04:22 PM Author Report Share #273398 Posted June 18, 2009 at 04:22 PM sorry, esqueci-me... ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now