Nuno Levezinho Posted February 24, 2012 at 11:06 PM Report Share #441083 Posted February 24, 2012 at 11:06 PM Boas, pretendo adicionar a uma data, 15 minutos. O Formato da data inicial é algo do género: 30-01-1970 1:15 AM Como faço para adicionar por exemplo, para adicionar 15 minutos? Link to comment Share on other sites More sharing options...
Gonka Posted February 24, 2012 at 11:17 PM Report Share #441084 Posted February 24, 2012 at 11:17 PM Não tens nenhum atributo que devolva o valor dos minutos dessa data? Se tens, somas 15 minutos. Link to comment Share on other sites More sharing options...
Nuno Levezinho Posted February 24, 2012 at 11:25 PM Author Report Share #441085 Posted February 24, 2012 at 11:25 PM $hoje = mktime (0, 0, 0, date("m") , date("d"), date("Y")); $data_hoje = date("m/d/Y g:i:s",$hoje); Supostamente o atributo i deve ser o dos minutos, mas nao tenho a certeza e não sei como somar. Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted February 24, 2012 at 11:34 PM Report Share #441086 Posted February 24, 2012 at 11:34 PM $hoje += 60*15; // 60 segundos * 15 minutos IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Nuno Levezinho Posted February 24, 2012 at 11:48 PM Author Report Share #441089 Posted February 24, 2012 at 11:48 PM Obrigado HappyHippyHippo isso funciona, mas o meu problema é que eu vou buscar a data a uma base de dados mysql, e depois não vou conseguir usar o mktime, certo? $data_bd = $coluna['campo_data']; Essa $data_bd mostra algo do género 30-01-1970 1:15 AM, como somo a isso 15 minutos? Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted February 25, 2012 at 12:02 AM Report Share #441093 Posted February 25, 2012 at 12:02 AM $hoje = strtotime($coluna['campo_data']); IRC : sim, é algo que ainda existe >> #p@p Portugol Plus 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