3
I have the month entered by the user. ex:
$mes = 11;
Now I want to pick up this month and return the current (day/year/hour) + the month reported:
2015-11-08 14:44:00
3
I have the month entered by the user. ex:
$mes = 11;
Now I want to pick up this month and return the current (day/year/hour) + the month reported:
2015-11-08 14:44:00
6
It can be done like this.
$data = date("Y-".$mes_informado."-d H:i:s")
0
Try:
<?php $mes = 11; $data = substr_replace( date( 'Y--d H:i:s' ), $mes, 5, 0 );
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
And where do the day and time information come from? whatever or whether it comes from the user? in what format?
– Sergio
I want to get the current server date/time same.
– Bia
And what output format do you want? Unix timestamp or formatted?
– Sergio
@Sergio Unix timestamp
– Bia
@Earendul the day/year/hour is the current month. Only the month is informed by the user.
– Bia
I got it, I thought you wanted the current weather. So it wouldn’t be current if the user informed a month that has passed or is to come..
– Franchesco