cenorasped Posted March 22, 2012 at 08:20 PM Report #445219 Posted March 22, 2012 at 08:20 PM $data = 15/02/2012; como adicionar 1 dia À variável data??
yoda Posted March 22, 2012 at 08:47 PM Report #445221 Posted March 22, 2012 at 08:47 PM Por exemplo : $timestamp = strtotime(str_replace('/', '-', $data)); $data = date('d/m/Y', $timestamp); Não foi testado. before you post, what have you tried? - http://filipematias.info sense, purpose, direction
cenorasped Posted March 22, 2012 at 08:54 PM Author Report #445222 Posted March 22, 2012 at 08:54 PM Não consegui! :s
HappyHippyHippo Posted March 22, 2012 at 09:05 PM Report #445224 Posted March 22, 2012 at 09:05 PM $data = date('d/m/Y', time() + strtotime("+1 day")); IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
cenorasped Posted March 22, 2012 at 09:12 PM Author Report #445225 Posted March 22, 2012 at 09:12 PM mas assim está adicionar 1 dia à data atual eu queria adicionar a uma data com o formato como tenho em cima!
scorch Posted March 22, 2012 at 09:14 PM Report #445227 Posted March 22, 2012 at 09:14 PM Podes juntar a sugestão do yoda e do HappyHippyHippo. 😉 $timestamp = strtotime(str_replace('/', '-', $data)); $data = date('d/m/Y', $timestamp + strtotime("+1 day")); PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum.
cenorasped Posted March 22, 2012 at 09:16 PM Author Report #445228 Posted March 22, 2012 at 09:16 PM da-me este valor : 01/04/1918
yoda Posted March 22, 2012 at 09:18 PM Report #445229 Posted March 22, 2012 at 09:18 PM Não consegui! :s Esqueci-me de adicionar o dia 😉 date_default_timezone_set('Europe/Lisbon'); setlocale(LC_ALL, 'pt_PT.utf-8'); $data = '15/02/2012'; $timestamp = strtotime(str_replace('/', '-', $data)); $data = date('d/m/Y', $timestamp + (60*60*24)); echo $data; http://codepad.viper-7.com/mQAP9s before you post, what have you tried? - http://filipematias.info sense, purpose, direction
cenorasped Posted March 22, 2012 at 09:20 PM Author Report #445230 Posted March 22, 2012 at 09:20 PM já consegui... obrigado a todos em especial ao yoda! 😉
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